How to collect emails

How to collect emails

In this support article we'll answer...
  1. What are the application's required emails?  How are they used?  
  2. How to collect and validate emails.
  3. How to collected multiple emails that sync with the database.  
What are the application's required emails?
There are two (2) required emails.
  1. The APPLICATIONEMAIL field.  This is a special field called: applicationEmail
  2. A field that is Synchronized with AGS's database.  This is a special field is called: email
What is APPLICATIONEMAIL used for?
  1. Application notifications are sent to this email.  Success messages, approval messages, hold messages, etc.
  2. This email will not receive ePasses.

What is the sync email used for?
  1. Syncing to the check-in software database.
  2. Sending ePasses.
What if I forget, delete, or never add these two email fields?
For both emails, there will not be an error.  
  1. applicationEmail: AGS will automatically add this field at the top of your application. 
  2. email: No email with sync with AGS's database.  
How to collect and validate emails.
A common configuration is to require applicationEmail & email to be the same AND perform an email validation check.   

Here is how...  

GO TO: CALCULATIONS TAB
Step 1
Use a calculation to perform an email validation check.
  1. Result Name: ConfirmEmailErrorMessage
  2. Expression: if(applicationEmail!=email&&if(strlen(email)>0,1,0),1,0)
  3. Attribute: Please return to the household section.  Email & Confirm Email must be the same email.
  4. Generates Error: Checked

GO TO: FORM TAB

Step 2
You must have the special APPLICATIONEMAIL FIELD in your form.
Add or confirm the following field...  
  1. Field Name: applicationEmail
  2. Field Label: Email
  3. Required for Patron: Checked 


Step 3
You must have the special EMAIL FIELD in your form that syncs.
Add or confirm the following field...  
  1. Field Name: email
  2. Field Label: Confirm Email
  3. Required for Patron: Checked
  4. Synchronized: Checked 

Step 4
Add a RICHTEXTHTML FIELD.  Place this text where you wish the text to appear if the error is triggered
  1. Field Name: DisplayEmailErrorMessage
  2. Initially Hidden: Checked 
  3. Hide/Unhide Calculation: {ConfirmEmailErrorMessage}
  4. Rich Text: Emails do not match

GO TO: PREVIEW TAB
Step 5
Preview & test your application using the preview tab.
  1. Complete your form
    1. Your help text will appear if the error is triggered



How to collected multiple emails that sync with the database.
The field "email" is a special field that synchronizes with AGS's database. 
  1. If you are only collecting one email per membership, this field is a single EMAIL FIELD.
  2. If you are collecting more than one email per membership, this field is a CALCRESULT FIELD that combine multiple emails.   
Most forms have a single EMAIL FIELD called "email".  This help article will show you the steps to switch from a single EMAIL FIELD to a CALCRESULT FIELD that combine multiple emails.    

GO TO: FORM TAB

Pre-Step
Most forms already have a field called "email".  You'll need to delete it first.  We'll add it back in later.  


Step 1
Create a EMAIL field on your form. Don't call it "email".  
  1. Field Name.  Use: email1
  2. Field Label.  Label this anything you wish.  For example, Primary Email or Email 1


Step 2+
Repeat step 1 and create 2 or more EMAIL fields 
  1. Field Name.  Use: email2, email3, email4, etc.
  2. Field Label.  For example, Secondary Email, Work Email, Email 2, Email 3, etc.
GO TO: CALCULATIONS TAB

Step 3
Create a calculation to combine the emails.
  1. Result Name: CombineEmail
  2. Expression: Write a calculation that adds the emails separated by a semicolon.
    1. If you are combining 2 emails, use: str(email1)+if(strlen(email2)>0,";","")+if(strlen(email2)>0,email2,""
    2. If you are combining 3 emails, use:  str(email1)+if(strlen(email2)>0,";","")+if(strlen(email2)>0,email2,"")+if(strlen(email3)>0,";","")+if(strlen(email3)>0,email3,"")
    3. If you are combining 4 emails, use:  str(email1)+if(strlen(email2)>0,";","")+if(strlen(email2)>0,email2,"")+if(strlen(email3)>0,";","")+if(strlen(email3)>0,email3,"")+if(strlen(email4)>0,";","")+if(strlen(email3)>0,email4,"")

Tip: Don't combine the applicationEmail.  This should be kept separate.  

GO TO: FORM TAB

Step 4
Create a CALCRESULT FIELD on your form. 
  1. Field Name: It must be named: email
  2. Field Label: A hidden field to combine emails: 
  3. Synchronized: Checked
  4. Initially Hidden:Checked
  5. Calculation Result Name (the Result Name in Step 3): CombineEmail

GO TO: PREVIEW TAB
Step 5
Preview & test your application using the preview tab.

Tip
Temporarily unhide the calculation in step 4 to view your test directly on the form.