OAuth Email Sending Through Business Gmail

:bullseye: What is your goal?

Hi Guys,

Pulling my hair out on this one…

I’m trying to send an email through OAuth to Gmail business account and the email is not:

  • Formatted correctly
  • Sending second email in the email chain

Any help would be appreciated :slight_smile:

:thinking: What is the problem & what have you tried?

I’ve LLM’d the bergeebers out of it.

And can’t improve export the correct encoded output.

Here is the content at the moment in a set variable module before sending it to google encoded:

{
{{if(8.threadId + " = “”“”“; “”; " ““threadId””: " + 8.threadId + “,”)}}
“raw”: {{base64(”““From: “” + " + 8.firstName + " + “” “” + " + 8.lastName + " + “” <”” + " + 8.email + " + “”>\nTo: “” + " + 8.to + " + “”\nSubject: “” + " + 8.subject + " + “”\n"" + " + if(8.threadId + " = “”“”“; “”; " ““In-Reply-To: <”” + " + 8.threadId + " + “”@google.com>\nReferences: <”" + " + 8.threadId + " + “”@google.com>\n"“”) + " + ““MIME-Version: 1.0\nContent-Type: text/html; charset=UTF-8\nContent-Transfer-Encoding: 7bit\n\n”” + " + 11.HTML Email Body + " + " + 42.signature)}}
}

This is what the endpoint receives:

accountId 1
to tim@gmail.com
subject Ohhhh Yeahhhhhh
body Testerino
provider google
firstName Tim
lastName Xxxxxxx
email tim@xxxxxllion.com
threadId

:clipboard: Error messages or input/output bundles

This is what ends up in the body of the email:

MIME-Version: 1.0
Content-Type: text/html; charset=“UTF-8”
Content-Transfer-Encoding: 7bit

Testerino

Regards,

External Media Tim
Enterprise Executive

+61 401 XXX XXX
tim@xxxxxxxlion.com
xxxxxxxion.com

External Media

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

And why are you sending an email with a generic HTTP module instead of the dedicated Email one?

It looks like you are trying to send it with HTML encoding but the endpoint is forwarding it as plain text.

Thanks for your input Stoyan.

I’m using that module because It is supposed to be able ot be configured to get the same outcome.

That combined with I will be getting my developer to hard code this as an api after it is working so it will be easier for him to understand/follow as a http module.

Can you please expand on your second point to help me understand?

Your email body has HTML tags inside. But those are not being translated to HTML, they are left inside as plain text.

<br> for example is new line.

<p>and </p> build a paragraph.

Then you are supposed to have a table of some sort.

Instead none of these are getting there, cause its being forwarded as plain text and not interpreted as HTML.

Thanks Stoyan.

How would you fix those things?

Check the API documentation for the endpoint you are calling and see how you can format your text. Usually there is a variable where you can tell it if you are sending plain text, HTML or markdown.

Ok will do. Thanks for the guidance

These doesn’t look right either.

You should not need to use additional double quotes. An empty string in Make is NOT "", but {{emptystring}}, which can be selected from the Variables Panel.

Your brackets, operators, functions, or special variables were not selected from the Variables Panel.

Try selecting it again from the Variables Panel, or type curly brackets like these {{ }} so that it ends up with a background color:

{{ ( }}
{{ / }}
{{ + }}
{{ = }}
etc.

Make Academy

You can learn more about this in these Make Academy units, as it covers selecting brackets, operators, functions, or special variables from the Variables Panel:

Setting up my first scenario

  • Scenario UI
  • Renaming, saving, and organizing scenarios
  • What is an app/module?
  • Configure a module
  • Connecting modules
  • Introduction to Mapping

For more information, see:

@samliew