Mac|Life

How to Automate mail merge for emails

-

Start with a subject

Type “ask” in the search bar (top left), and drag “Ask for Input” from the results into the pane on the right. Set the question to “What’s your message’s subject?” Leave the answer empty, and set the input type to Text.

A safety check

Before you construct your email, take a look at your selected contacts and check whether any of them has no email address. Add the “Find Contacts” action; you can use it to filter out inappropri­ate contacts.

Get the addresses

Note the line between actions, from Select Contact all the way into the Repeat loop: Each time the Repeat loop begins, it will take a new contact from those it receives. Add “Get Email Addresses from Input” to the loop.

Set the body

Add a second “Ask for input” action below the first. Set its question to “What is its body (without greeting/ sign-off)?” and the answer and input type as before. It’s correct that no data is passed down to this action.

Filter contacts

A line shows this gets contacts from the last action. Tap Add Filter, then tap Group and pick Email Address, change “is” to “contains,” and replace “anything” with “@.” People with no email address will be discarded for now.

Multiple addresses

The items now at your disposal are email addresses belonging to the contact being dealt with. If the contact has several, you want to choose which to use. Add the “Count” action within the loop, and set it to count items.

Select pic & people

Find and add a “Select Photos” action at the bottom of the workflow. Our example allows attachment of one image. Find and add the “Select Contact” action and set it to allow multiple people to be selected.

Repeat action

Next, add a “Repeat with Each” action. Between the two bars this adds to the workflow, you’ll use several actions to send the same overall message, yet personaliz­ed, repeating until all contacts have been sent one.

Check for multiples

Add an “If” action next in line. This adds three bars: If, Otherwise, and End If. In the first, set the condition to check if the received number is greater than 1. If so, you’ll need to perform an extra action to offer a choice.

Check input & output

Tap the If action’s title and you’ll see that it passes forward its input — the quantity of email addresses. You need the actual email addresses — use a Magic Variable: Add the “Get Variable” action, and tap Choose Variable.

Personaliz­ed prompt

It may not be obvious exactly who an email address belongs to, so let’s tailor the prompt with the name of the person being emailed on this pass through the Repeat loop. Tap the Repeat Item token in the keyboard’s top row.

Use a Magic Variable

Next, tap Magic Variable. All of the actions in the workflow will spread out a little, with pill-shaped tokens between them. Find “Get Email Addresses from Input” in the workflow, and tap the token labeled Email Addresses just below it.

What’s substitute­d?

After you insert the token into the prompt, it’ll be selected and a contextual panel will appear at the bottom of the screen. That panel should indicate that the contact’s full name will be used in the token’s place when the action runs.

Choose an address

To list those addresses so you can choose one, add the “Choose from List” action. Ensure Select Multiple is off, then set the action’s prompt to “Use which address for ?” and place the insertion point right before the questionma­rk.

With one address

If the contact has only one email address, the workflow will proceed along the If action’s Otherwise branch instead. In that branch, we need only to retrieve that address, so add a “Get Variable” action just below the Otherwise bar.

Retrieve the address

Tap Choose Variable in the action and choose Repeat Item; it’ll appear as a token within the action. Tap that token to be presented with a list of info that can be retrieved from the item (a contact). Choose “Email address,” then tap Done.

Add prewritten body

Remove “Two” from the second row to serve as a blank line in our email. Add a third row and set its contents to a Magic Variable containing the second “Ask for Input” action’s result. Rename the variable “msgBody” for clarity.

Check your work

Check that you have two actions (“Get Variable” and “Choose from List”) between If and Otherwise, and only “Get Variable” between Otherwise and End If. The result that will be passed forward now will always be a single email address.

Sign off your email

Add another blank item, then add two more for “Kind regards,” and your name, for example. Add one last item to the list: make it a Magic Variable that takes the output of the Select Photos action, and rename that “Photo.”

Start composing

We have all the info we need for our email. Below the End If bar, add a List action. Replace its first item with “Hi” followed by a Magic Variable; use the techniques you already learned to set it to Repeat item’s first name attribute.

Send the email!

Add Send Email next. Let it show its Compose sheet until you’ve tested the workflow. In the “To” row, add a Magic Variable for the result below “End If”; call it “msgRecip”. In Subject, add the very first action’s result; call it “msgSubject.”

 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??

Newspapers in English

Newspapers from Australia