Using MailerSend for transactional emails

Hi,

Is there anyone out there who has successfully set up MailerSend with their Bubble app using the API connector? And is willing to share/help with the correct settings?

Can’t find even a single mention of MailerSend anywhere on the forum!!!

Hello! :wave:

Yes, we can guide you with connecting MailerSend using the API connector.

Once you’ve added the API name, you need to set the Authentication to “None or self-handled” and then add the following shared headers:

Key: Authorization
Value: Bearer {Your MailerSend API Token}

Key: Content-Type
Value: application/json

Key: X-Requested-With
Value: XMLHttpRequest

If you’re adding a call to send an email, make sure you select the Data type as “Empty” otherwise you won’t be able to initialize the call.

We hope this helps!

2 Likes

For anyone still struggling, these videos where helpful:

Part 1 - Mailersend Bubble Transaction Emails - Part 1 - YouTube
Part 2 - Mailersend / Bubble Transaction Emails - Part 2 - YouTube

1 Like

@MailerSend can you assist. I’m seeing this error:

This is my body script:

{
    "from": {
      "email": "team@tracksmallwins.com",
      "name": "TrackSmallWins.com"
    },
    "to": [
      {
        "email": "<toemail>"      }
    ],
    "subject": "<subject>",
    "html": "<body>,
    
"template_id": "xxxxxx"
  }

Hi @mayur,

You’re simply missing a quote (") at the end of <body>

Your code should look like the following instead:

{
    "from": {
      "email": "team@tracksmallwins.com",
      "name": "TrackSmallWins.com"
    },
    "to": [
      {
        "email": "<toemail>"
	  }
    ],
    "subject": "<subject>",
    "html": "<body>",
    "template_id": "xxxxxx"
}
1 Like

Ah!! Such a simple thing

By the way, for anyone watching this thread… here is the API JSON call that ended up working for me so far…

{
    "from": {
      "email": "team@tracksmallwins.com",
      "name": "TrackSmallWins.com"
    },
    "to": [
      {
        "email": "<toemail>",
        "name": "<toname>"
      }
    ],
    "subject": "<subject>",
    "html": "<emailbody>",
	"template_id": "xxxxxxxxx",
    "variables": [
      {
        "email": "<toemail>",
        "substitutions": [
          {
            "var": "body",
            "value": "<emailbody>"
          }
        ]
      }
    ]
  }

Following up on this for anyone looking for answers, Neils videos mentioned above were very helpful. I can now get the API call to work fine and I can send test emails now from the API settings.

Transactional emails inside my app don’t work though. I’m asking @neilpierce for some assistance to see if he spots the issue.

Here is the video I sent Neil:

Also, look at your server logs to see if the email is being formatted properly:

I will update this thread once I have some answers

This should fix you up.

1 Like

Thanks @neilpierce for looking into it. That was it! I would never have figured it out.

Recording a video here for anyone else trying to figure this out:

1 Like