Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Email Script

Featured Replies

I’m trying to set up an Email Script.

There are 80 customers in a data base.

I have 2 groups to send email to:

6 specific customer names are assigned to “group A”

The other 74 customer names are assigned to “group B”

I want the script to work in the following fashion:

When in a record, if the customer name belongs to “group A”, then the “sent to:” should read “group A” after the script trigger button is clicked.

If the customer name belongs to “group B”, then the “sent to:” should read “group B” after the script trigger button is clicked.

Question: To achieve this, what would be the syntax to apply on the “Email To” Calculation?

See enclosed

post-103927-0-19136600-1398712759_thumb.

Something like:

 

relatedCustomer::group

How is it decided that the Customer belongs to Group A, or Group B? Personally, in the script I'd set a variable for the Group the Customer belongs to, then set the field explicitly after the email is sent... Like: SetVariable[$customerGroup; Value:Content::CustomerGroup] Do email sending etc SetField[Content::SentTo; $customerGroup]

Question: To achieve this, what would be the syntax to apply on the “Email To” Calculation?

 

I am afraid this question makes no sense; the "Send Mail" To calculation needs to calculate the e-mail address of the recipient/s. Neither "group A" nor "group B" are valid e-mail addresses, and if you successfully specify one of them, your mail will not be sent.

  • Author

Ok this is what I'm using and it works for the group of 6 customer you see below:

 

If (Content::Customer= "South Miami Hospital"; "Group A"; "")
& If (Content::Customer= "Baptist Hospital of Miami"; "Group A"; "")

& If (Content::Customer= "Homestead Hospital"; "Group A"; "")
& If (Content::Customer= "Mariners Hospital"; "Group A"; "")
& If (Content::Customer= "Doctor's Hospital"; "Group A"; "")
& If (Content::Customer= "West Kendall Baptist"; "Group A"; "")

 

the problem is to do the same for the rest of the 76 customers ("Group B") without writing them all out one by one.

for example:  If (Content::Customer= "Name of customer that is not part of group A, what ever the name might be,<-- don't know how to formulate this syntax"; "Group B"; "")

and link the two segments.

No worries about how the groups are set up,...just want the script to write either "group A" or "group B", on the mail to (groups are recognized by email app itself)

Please let me know your ideas,...Thank you

Ok this is what I'm using and it works for the group of 6 customer you see below:

 

If (Content::Customer= "South Miami Hospital"; "Group A"; "")

& If (Content::Customer= "Baptist Hospital of Miami"; "Group A"; "")

& If (Content::Customer= "Homestead Hospital"; "Group A"; "")

& If (Content::Customer= "Mariners Hospital"; "Group A"; "")

& If (Content::Customer= "Doctor's Hospital"; "Group A"; "")

& If (Content::Customer= "West Kendall Baptist"; "Group A"; "")

 

Since being in a group obviously is an attribute of a customer, the easiest solution is to add a field to the Customer table, assign the respective value ("Group A" or "Group B") to each record, then simply read from that field, i.e. use the expression Content::group.

 

As for the way to code these calculations: you would use OR instead of chaining multiple If()s …

Let (
  c = Content::Customer ;
  Case (
    c = "South Miami Hospital" or c = "Baptist Hospital of Miami" or c= "Homestead Hospital" or c = "Mariners Hospital" or c = "Doctor's Hospital" or c = "West Kendall Baptist"; "Group A" ;
    c = "..." or etc. ; "Group B"
) )

… or 'simpler' and less cluttered, test for list membership …

Let ( [
c = Content::Customer ;
aList = List ( "South Miami Hospital" ; "Baptist Hospital of Miami" ; "Homestead Hospital" ; "Mariners Hospital" ; "Doctor's Hospital" ; "West Kendall Baptist" ) ;
bList = List ( manyNames . . . )
] ;
Case ( 
  not IsEmpty ( FilterValues ( aList ; c ) ) ; "Group A" ;
  not IsEmpty ( FilterValues ( bList ; c ) ) ; "Group B"
) )

… but while all this is syntactically correct, it's not the right approach.

  • Author

"Since being in a group obviously is an attribute of a customer, the easiest solution is to add a field to the Customer table, assign the respective value ("Group A" or "Group B") to each record, then simply read from that field, i.e. use the expression Content::group."

 

Yeap,...that resolved it, simple an easy!

Thank you so much, eos and all that reply!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.