Add secondary email address to user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2022 12:31 PM
How to add secondary email address to the user table, as he needs email notification to be sent
or Can we add to the email script ?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2022 01:30 PM
You don't generally want to hard-code data like email addresses in scripts. Depending on your actual business need, there are a couple of options available. Your statement seems a bit vague. The user record already has an email field... if a user needs to receive a notification, why will not existing field and value not be sufficient?
1. If you need to have the need for users (i.e. many or most) to have multiple email addresses, you can add a list field to the user record or you can add a new table containing email addresses and relate the email addresses to the users.
2. If you have a unique use case, you can set a system property and retrieve that in the email script.
3. If you need to send an email to a company address that is not unique to any individual, then you can add the email field to the company record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2022 02:50 PM
I have requirement where the particular user needs to be notified on both of his address,
2. If you have a unique use case, you can set a system property and retrieve that in the email script. (CAn you provide details about this step?) this seems fine for me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2022 03:12 PM
This seems to be a really weak use case... I would push back on this and suggest that the user should update their email address if the one provided is not sufficient. Creating a system property because one user doesn't want to check their email of record is not typically worthy of the cost to implement and maintain. If the user is a VIP, then of course, the value can be argued accordingly.
Having said that, you can set a system property, simply by adding a new record to the sys_properties table, then use the gs.getProperty( 'system_property_name' ); function to retrieve the value in your mail script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2022 05:53 PM
Hi,
With system property, I think John means when there is only 1 or few users needing to have a secondary email, set their secondary email as a system property individually . This obviously won't work if there are many users requiring secondary email.
Want to clarify the requirement. Is it just to send to several email addresses? If there is a need to search user based on email address, just adding new email address won't work. It would be necessary to search on both fields. That is, if there is any script searching by email, it would need to be fixed to search on both fields.