Hi All,
I have set myself a goal of mastering automation with Make.com. I am on week 3 of my journey and am building my first project . To help with motivation I decided to build an automation that would send me an AI generated motivational email either daily or weekly. I would be delighted if people check it out and give some feedback.
As a software developer for almost 20 years I understand that there is clean code and well… the opposite of clean code! The same probably applies to Make scenarios right? There will be clean ones and not so clean ones. I am curious to find out where my scenario is currently sitting, if it can be improved etc. Maybe there are better ways of doing what I implemented .
I am attaching the blueprint but will also breakdown where I spent most of my time.
The email output from the call to ChatGPT was a Long String with multiple newlines.
First I passed this directly to my Gmail - Send an Email module, but there were two issues.
- I had no subject, it was part of the main email body.
- The email text was all on one line, it no longer had the newlines.
To solve these issues, first I used Tools - Set variable to create a variable called email_subject_content_array. I split the Long String email text into an array, splitting on two newlines.
Next I used the Tools - Set multiple variables to create two variables, email_subject and email_content.
I mapped the first item from the array email_subject_content_array to email_subject, replacing ‘Subject:’ with an emptystring.
I then joined the remaining items from the array using two html br tags as the separator and mapped it to email_content. This would ensure that the newlines would appear in the email.
And here is the final product! Thanks in advance for any feedback
.
Blueprint:
ai-generated-email.json (39.3 KB)