When you register an email address using the /registerEmail API call and immediately follow up with a /createEmailMessage call to send an email to that same address, delivery might occasionally fail. This can happen because the registration and message sending processes operate asynchronously.
There's a possibility that the /createEmailMessage request is processed by the system before the email address registration is fully completed and the address becomes available for targeting.
Here are two ways to ensure reliable delivery in this scenario:
Use the
use_auto_registrationParameter: The recommended method is to include"use_auto_registration": truewithin thenotificationsobject of your/createEmailMessageAPI request. This parameter instructs the system to ensure the email address provided in the"devices"array is registered before attempting to send the email.Example
/createEmailMessagepayload snippet:{ "notifications": [ { "send_date": "now", "ignore_user_timezone": true, "email_template": "YOUR_TEMPLATE_CODE", "devices": [ "user@example.com" ], "use_auto_registration": true // ... other notification parameters } ] // ... other request parameters like auth, application }Note: This approach handles the registration itself. If you also need to set user tags immediately after registration using
/setTagsand use those tags in the very first email, the tags might not be set in time with this method alone. See the next option.Introduce a Short Delay: If your process involves registering the email (
/registerEmail) and then immediately setting tags (/setTags) which are necessary for personalizing the first email template, you should introduce a brief pause in your application's code. Wait for a short period (e.g., 5 seconds) after receiving successful responses from both the/registerEmailand any subsequent/setTagscalls, but before making the/createEmailMessagecall. This delay allows time for the registration and tag data to be fully processed and available for the email sending operation.
Choose the method that best suits your workflow requirements.
Comments
0 comments
Please sign in to leave a comment.