1. Calculation functions
  2. All Functions
  3. Miscellaneous Functions
  4. MAILTO

Composes the To, cc, Bcc, subject and body of an email.

The MAILTO function can be used to generate click-able links that will send alerts and data to recipients via email. This can be used as a semi-automatic alert system. The emails can be generated and addressed, and alerts color-coded, but still require someone to go in and click the link to actually send them.

You can use this function to embed a direct link to an Anaplan model in the body of the email using the model's URL. This is useful if you're using a mobile device, or if you want to email users a direct link to a landing dashboard for easier access. The URL-encoding performed by the MAILTO function allows characters such as '&' (and the URLs that use them) to be in the subject line or body of the email.

The MAILTO result must be of data type Text_Email. The inputs are all text data type and must be put in double-quotes if hard-coded into the formula.

The MAILTO function is supported for use with Microsoft Outlook, Gmail, and iCloud across all supported browsers. Yahoo Mail is not supported. Other mail clients may be supported but are unverified by Anaplan.

Syntax

MAILTO(u, v, w, x, y, z) where:

  • u: Text: Click-able link text
  • v: Text: Email address
  • w: Text: Email address - copy address(es)
  • x: Bcc: Text: email address - Hidden copy address(es)
  • y: Text: Email subject line
  • z: Text: Email body text

Back to Top

Format

Input Format Output Format

u: DisplayText: Text

v: Text (email address)

w: Text (email address)

x: Bcc: Text (email address)

y: Subject: Text

z: Body: Text

Text_Email

Back to Top

Arguments

The function uses the following arguments:

  • u: Text: Text-formatted line item, text constant, or general expression
  • v: Text: Text-formatted line item, text constant, or general expression (email address)
  • w: Text: Text-formatted line item, text constant, or general expression (email address)
  • x: Text: Text-formatted line item, text constant, or general expression (email address)
  • y: Text: Text-formatted line item, text constant, or general expression
  • z: Text: Text-formatted line item, text constant, or general expression

Back to Top

Constraints

The function has the following constraints:

  • The MAILTO result must be formatted in Blueprint as Text - Email.
  • Yahoo Mail is not supported.

Back to Top

Excel equivalent

Back to Top

Example

MAILTO function that uses a series of text-formatted line items as inputs.

Mailto Result = MAILTO(Label, To, cc, Bcc, Subject, Body WRAP TEXT)

Once you click the link to send the email, you'll see something like this:

Some mail clients will not output the model URL as a click-able link.

MULTIPLE RECIPIENTS

Comma-separated values are allowed in the To, Cc and Bcc fields for multiple recipients. Make sure that the recipients are comma-separated and enclosed in double quotes to indicate that it is all part of the ‘To' field and not part of the ‘Cc' field.

MAILTO("click here", "sally.silverman@anaplan.com,gloria.gold@anaplan.com", cc, Bcc, Subject, Body)

Once you click the link to send the email, you'll see something like this:

Limitations when using Microsoft Outlook with multiple recipients

Be aware that if you're planning to use the MAILTO function with multiple recipients (in the To, Cc, or Bcc fields) using Microsoft Outlook, separating recipients using a comma is not supported and you'll be advised to replace the comma with a semi-colon. However, using a semi-colon in the MAILTO calculation to separate the recipients is not supported in Anaplan.

If you use Outlook 2003 or 2007, using the MAILTO function to send emails only works when sending to a single recipient. This is because, by default, Outlook 2003 and Outlook 2007 do not recognize the comma as an email address separator.

Outlook 2013 can be configured to use commas to separate multiple message recipients. Be patient... once set, any commas will be replaced automatically with semi-colons after a few seconds.

Back to Top

MAILTO WITH BLANK CC

If fields are left blank in a hard-coded formula they still require both double quotes. In the example below, the cc field is left blank.

MAILTO("click here", "sally.silver@anaplan.com,gloria.gold@anaplan.com", " ", Bcc, Subject, Body)

Once you click the link to send the email, you'll see something like this:

MAILTO function to populate an automated email with fields

You can also set up a formula to populate all of the fields based on other fields in a module, or use a combination of other fields in a module with hard-coded fields:

MAILTO("Notify", Contact emails, "", "", "Anaplan notification", "Your targets have been set")

In this example:

  • Notify is the text shown in the link
  • Contact emails is the name of a line item where the list of target emails is concatenated in a text list (the To field)
  • "" and "" are the cc and Bcc
  • Anaplan notification is the Subject line
  • Your targets have been set is the body of the email.

You can have the subject and body link to other line items if required. In the above example, the line item used in the To field is a text list function (text, separated by commas). You can use formulas to pull any combination of emails you need to achieve this.

Back to Top

Similar functions