Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I need to create templates for mail in Drupal using MimeMail and I need to use Mailjet for tracking the send email.
But the two modules seems not working together. When one is active the other one doesn't work anymore.
I've tried to change settings in the modules configuration. I've searched in the code of the two modules. I've tried with another mail module: HTML Mail.
I have found nothing.
Have I done something wrong or their are just incompatible ?
Someone has the solution ?
Thanks
Comments
Comment #1
rkcreation CreditAttribution: rkcreation commented+1
Seems Mime Mail sets the mail content-type to "multipart/alternative", and phpMailer doesn't support this by this way...
Comment #2
Mailjet Plugins CreditAttribution: Mailjet Plugins commentedHi there ;)
There is a conflict between 'Mail System' and the Mailjet module.
'Mail System' is a part of 'mimemail' (and 'HTML Mail' btw).
Steps to resolved (untested):
1. Download & Install MailSystem UI
2. Set Forward Class Mail as "SmtpMailSystem" in "admin / config / system / MailSystem".
And... try ;)
Best,
Comment #3
blandon12 CreditAttribution: blandon12 commentedIt seems there is no "SmtpMailSystem" in forward class mail from "admin / config / system / MailSystem"
Comment #4
Mailjet Plugins CreditAttribution: Mailjet Plugins commentedComment #5
kristofferromReopening this as it's not fixed as far as I can see. There is no "SmtpMailSystem" in forward class mail from admin/config/system/mailsystem.
If Mailjet is selected in any of Mail Systems classes at /admin/config/system/mailsystem emails aren't formatted as HTML.
We do need Mime Mail or HTML mail to send messages as HTML through Mailjet right? I've tried with only Mailjet module enabled and emails wasn't formatted.
Comment #7
sebiad CreditAttribution: sebiad commented+1, we have the same problem. Did you find the solution?
What is the advantage of using Mailjet for only emails in text format? :-s
Thanks
Comment #8
hargobindI changed the issue Component from Code to Documentation for this reason:
This is not a limitation of MailJet, it's a limitation of how Drupal's mail system uses a single class for both *format()* and *mail()*. So if you choose to send mail through MailJet, then you will have to deal with the standard "plain text" formatter.
Fortunately, there is a solution to this:
First be sure to have either the HTML Mail or Mime Mail modules installed.
Choose either option below:
1 ) Install the Mail System module, visit the Mail System configuration page, and use the "New Class" section at the bottom to generate a new format/mail combo. This essentially creates a dummy class which delegates the *format()* call to one module and *send()* to another.
2 ) I created a sandbox module called MailJet Formatter Bridge which simplifies the process of generating a new class with the MailSystem module. It will detect if you have either the HTML Mail or the Mime Mail module and use its formatter, then it will use Mailjet to send the email. Assuming you know how to download sandbox modules, the module is simple and only needs to be installed to work.
Comment #10
SlimGrin CreditAttribution: SlimGrin as a volunteer commentedI attempted option 1 above, setting format to "MimeMail" and mail to "MailjetSmtpMailSystem." When I do this, it still comes through as plain text. I noticed that making this change also unchecked the box on the MailJet config page, "Send emails through Mailjet." If I re-click it I lose the changes on the Mail System config.
Any ideas what I'm doing wrong?