mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:04:39 +03:00
webapi: implement adding "alternative files" to messages sent with the Send method
with new field "AlternativeFiles" in the JSON body, or with "alternativefile" form file uploads. can be used if there is a (full) alternative representation (alternative to text and/or html part), like a calendar item, or PDF file. for issue #188 by morki
This commit is contained in:
@ -114,10 +114,10 @@ func badResponse(hresp *http.Response) error {
|
||||
// Configure webhooks to receive updates about deliveries.
|
||||
//
|
||||
// If the request is a multipart/form-data, uploaded files with the form keys
|
||||
// "inlinefile" and/or "attachedfile" will be added to the message. If the uploaded
|
||||
// file has content-type and/or content-id headers, they will be included. If no
|
||||
// content-type is present in the request, and it can be detected, it is included
|
||||
// automatically.
|
||||
// "alternativefile", "inlinefile" and/or "attachedfile" will be added to the
|
||||
// message. If the uploaded file has content-type and/or content-id headers, they
|
||||
// will be included. If no content-type is present in the request, and it can be
|
||||
// detected, it is included automatically.
|
||||
//
|
||||
// Example call with a text and html message, with an inline and an attached image:
|
||||
//
|
||||
|
@ -115,6 +115,11 @@ type SendRequest struct {
|
||||
// Unless a User-Agent or X-Mailer header is present, a User-Agent is added.
|
||||
Headers [][2]string
|
||||
|
||||
// Alternative files are added as (full) alternative representation of the text
|
||||
// and/or html parts. Alternative files cause a part with content-type
|
||||
// "multipart/alternative" to be added to the message. Optional.
|
||||
AlternativeFiles []File
|
||||
|
||||
// Inline files are added to the message and should be displayed by mail clients as
|
||||
// part of the message contents. Inline files cause a part with content-type
|
||||
// "multipart/related" to be added to the message. Optional.
|
||||
|
Reference in New Issue
Block a user