-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support sending Calendar event with API #188
Comments
Hi @morki! You should be able to add files to outgoing messages with the webapi. Either inline or as attachments. See the "Send" method, https://pkg.go.dev/github.com/mjl-/[email protected]/webapi#Client.Send. The SendRequest has fields InlineFiles and AttachedFiles, see https://pkg.go.dev/github.com/mjl-/[email protected]/webapi#SendRequest. Instead of including the file data in the JSON request, you can also make a multipart/form-data request with form field(s) "inlinefile" and/or "attachedfile". The Client.Send docs have a curl example to make such a request. I hope that's enough to make the webapi an option. If this isn't working or convenient, I'm interested in learning what the blocker is. I'm not sure it's a good idea to add a field for this specific type of attachment. I can see how this is useful for this use case, but other use cases will likely follow. Also, I'm still working on calendaring support in mox. When that is ready, a higher-level API for composing + enqueuing messages with calendar events but be more helpful. I'm thinking about something like adding a "CalendarEvent" field to a SendRequest where you add a JSON object with start/end/title/location/etc fields, and an ICS file is composed and added to the message. |
Thank you very much for your response. I know about attachment support, but I think it is not the same. I will try to explain. When you attach files, it constructs different mime cascade as seen in this link: https://www.simplejavamail.org/rfc-compliant.html#section-explore-multipart But what I was looking for is this: Where iCalendar event is just alternative part on the same level as HTML and plain text. I think the future addition of I look forward to calendaring/contact support in mox, it will be huge :) |
Thanks for the explanation, that makes sense. What if we add a new field |
Yeah, it will be awesome and more generic :) |
…e 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
@morki The commit just now adds the AlternativeFiles field to the request body of the Send method. A form file field "alternativefile" will work as well. Similar to inline & attached files. |
In our application, we need to send calendar events together with our emails. For now we are using Simple Java Mail to compose our messages and send with SMTP.
We would like to use Mox Web API to send those directly, but in API documentation there is no field for calendar part.
Here is nice structure compositor to see how to integrate calendar part into multipart message: https://www.simplejavamail.org/rfc-compliant.html#section-explore-multipart
I would like to propose addition to API:
or maybe more generaly some
AlternativeParts
array with content type and body.The text was updated successfully, but these errors were encountered: