How to send html mail in drupal 8 rules - drupal-8

I want to use rules module to send the HTML mail, directly form the UI, But in drupal 8 send mail action only shows Send Message body as text field.
Can I use it to send the HTML mail directly like can I use default CKeditor or dynamic mail template to send a for specific purpose, I want to use it with different token parameters to send at bulk using some action.
Thanks.

Related

send both attachment and template in single email with AWS(SES) in node

I want to send an email using AWS(SES) in nest js app. In that I want to send pdf attachment and html template in a single email. I searched for it but not succeeded to find a solution.
i found to method two methods in doc that are sendRawEmail and sendTemplatedEmail . currently using "sendTemplatedEmail" this one to send template email.
but i want to send both in a single email.
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SES.html#sendEmail-property

How to strip attachments from inbound mails in Mailgun before POSTing?

Is it possible for Mailgun to POST only the non-attachment part of emails to my API, to prevent big attachments affecting the performance of the app?
Mailgun can host the attachments for you with the inbound functionality.
You can use the Events API command store(notify=”http://myapp/post”) specifying as shown the notify option, which will send a webhook to your application with a URL on message arrival.
One of the headers sent with through webhook will look something like: ["[{\"url\": \"https://api.mailgun.net/v2/domains/YOURDOMAIN/messages/ALARGESTRINGOFCHARACTERS/attachments/0\", \"content-type\": \"META/META\", \"name\": \"MYFILE.EXT\", \"size\": 74622}]"]
Then you can retrieve it and delete the stored message.
Keep in mind that stored messages are kept only for so long so you should process attachments rapidly.
This is one of the options of the routes functionality that Mailgun gives you.
Personally I love it ! Let me know if something is unclear i can dig into more details!
Best,
I am getting mail on the Mailgun which I am routing to my local server and their. I am parsing the JSON but problem is coming in case of attachments. In attachment json, it is showing the path of temporary file on mailgun server. I need to download the attachment and store it on my local machine.
My question is how to retrieve that attachment. Do we have any API for that?
To access the data from the link, you will need to specify credentials as your get parameters. The user is 'api' and the password is your mailgun's private key
Please refer to this answer that I've given here

Deal with timeouts when posting data -no ajax

The use case:
User makes order his payment gets accepted and his details are getting post to a django's view. Using these details django's view creates user and everything that is necessary (Username and password is provided by me). Then before returning it sends email to clients email with his data (Username and password for now).
But sometimes I get a gateway timeout error from apache(app is deployed on openshift). Because the user is created I assume that the timeout comes from the email sending part. How can I make sure everything went ok and inform the user? How can I make sure that if the email isn't sent I can resend it? What is the best practice at that?
If you have timeouts with an API or Service, you should fire your POST / sendmail request with AJAX...
Serialize the whole form (like jQuery's serialize())
Send that data via AJAX (with jQuery's ajax())
Inform the User of success or error (alert() or jQuery UI dialog)
You can find a lot of examples on this website.
Another "dirty" approach would be to add the attribute target="_blank" to your form tag what opens your lazy request in a new tab / window.

how to send email with gmail compose from my application?

When the current user of my web-application select other users who will send them email with Gmail, i want to redirect him to the gmail compose (Link) and then type his message.
In my django view, before clicking on "Mail To" i have retrieved a list of distination users.
Is it possible to affect those users to destination in gmail ?
If you want to include multiple recipients then in template do it like this:
Send email
Here is an example in jsfiddle. You can add subject and body also:
Send email with subject and body
See more tips and tricks here

How to request operating system to send email?

How can a Qt C++ app request the OS to send email with a specific subject, body and possibly an attachment(s) files? It should be dispatched using the configured default email client.
It looks like QDesktopServices::openUrl() will accept a mailto: URL. But specifying an attachment could be tricky.
I've written a small component that handles attachments too. It creates a temporary .eml file filled with the content that you provide to the Email class and opens the default email client with openInDefaultProgram(). The API should be self explaining, but if you have any problems, please don't hesitate to contact me :)
https://github.com/picaschaf/qt-email