We are using the Mautic API to send emails to our users.
One of the emails we send is when a user account is being created, the user should get 2 emails, 1 with their username + instructions and 1 with their password.
In our script we check if a contact with that email exists.
NO: → Create a new contact, send the email(s), delete the contact
YES: - >Send the email(s)
The issue we’re running into now:
Keeping the new user account above as an example (should get 2 emails).
Contact does NOT exist within Mautic
Contact is being created by our script (works fine)
First email with username and instructions is being sent (works fine and also see it in Reports)
Second email with password is being sent (this does NOT work, also do not see the email in Reports)
Contact is being deleted by our script (works fine)
Contact DOES exist within Mautic
First email with username and instructions is being sent (this does NOT work, also do not see the email in Reports)
Second email with password is being sent (this does NOT work, also do not see the email in Reports)
We had an older instance of Mautic (version 4.4.7) and it was working fine there.
How can we reproduce this issue?
Step 1: Sent an email through the API using an existing contact
There is no error at all, Mautic is reporting the email to be sent out while it’s not.
Like I said in the original post, if a new contact is being created the contact gets one email (should get two) and when a contact already exists, the contact gets none (should get two).
Reponse
Do you get a json ‘{ “success”: 1 }’ response?
Can you check if the contact is not DNC you are trying to send? (Red icon next to the name). It happens often that you try with some dummy email, it bounces and can’t send email to the same person again
Is there a setting in your Mautic at Email Settings > Frequency - max 1 email / day?
Essentially the API endpoint is now enforcing that emails of type list are only allowed to be sent once per contact. If you want to send an email to a contact more than once you will need to change the email_type in the database to “template”.