Skip to content

Allow /@email-send endpoint sending multipart messages #1956

@me-kell

Description

@me-kell

/@email-send endpoint prepends a message_intro to the message (see plone/restapi/services/email_send/post.py).

If you send a multiple part message, the prepended message_intro makes your multipart message a simple text message. Thus not being able to send e.g. attachments.

My workaroud at the moment is to comment out line #108 of plone/restapi/services/email_send/post.py.

A better way could be a simple boolean field (e.g. disable_message_intro) that would let disable to prepend the message_intro:

{
  "name": "John Doe",
  "from": "[email protected]",
  "to": "[email protected]",
  "subject": "Hello!",
  "message": "Just want to say hi.",
  "disable_message_intro": true
}
    if not disable_message_intro:
        message = f"{message_intro} \n {message}"

Or adding a field message_intro which will be added only if not empty.

Or completely removing the prepending of a message_intro.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions