Update email address

Update email address

Comments

  • Hi,

    I have a question regarding a way to update the email address on some accounts. The way our company is set up, we all have 2 email addresses. These email addresses can change over time as well as people can be moved from one subcontracting company to another. We are having an issue where their decisions account is not set up to their “primary” email they are wanting to use. We are in the process of making sure everyone’s primary email is set correctly in AD since this is what we are using to sync the decisions account with. However, we still have data in the system with some of these old email address. Is there a way we can update all the old emails to the new ones? Or is this going to have to be a custom sql script?

  • The best way to this would be to make those changes in AD and re-sync as you mentioned. We can, however, run a custom SQL script to replace the company domain on account email addresses and entity names. See below SQL scripts that will do so:

    [b]******IMPORTANT: Backup your database before running these queries.******[/b]

    UPDATE entity_account
    SET entity_name = REPLACE(entity_name, @company1.com, @company2.com)
    WHERE account_id = [ACCOUNT ID]

    UPDATE entity_account
    SET email_address = REPLACE(email_address, @company1.com, @company2.com)
    WHERE account_id = [ACCOUNT ID]

Sign In or Register to comment.