These been some discussion about Build-In vs In-line methods, here is a quick example of a Built-In method that sends email from instance attributes that is quite commonly done as a In-Line method when it does not need to be In-Line.
Start by creating a Class called Email
Set your schema as follows;
In your new class create a new method, but this time change the method type to Build-In, and add the following detail. Notice I have set parameters also to the method.
Set the values to you instance in the new email class to the following, notice how I have also used variables in my strings to grab dynamic data.
The output in the automate log should look something like;
And when you test the BuiltIn Method, you will get and email just like the below
So how do we use this?
Every time you want to send an email, you simply link to an instance in the email class as a relationship. Example;
You have a state machine with many steps, somewhere you wish to send an email, add to your state machine a relationship to the email class and create an instance within the email class to send the email, with the body, subject set the way you wish. As shown here, the last line in the state machine is a replica of the one before, except I am using a builtIN method vs the one before is a IN-Line.
My email instance is set as follows,
The last thing to cover of is WHY???
Simply put an InLine Method will spawn a new environment space, where as BuiltIN is exactly that. Therefore BuiltIN is faster and lighter that InLine Methods.