Search In This Blog

Showing posts with label Email. Show all posts
Showing posts with label Email. Show all posts

2016-09-28

Changing a user's email address without confirmation.

When try to change user's email, Salesforce will send a confirmation mail to new email address and a notification mail to old email address in security purpose.But sometimes user don't want to get further notifications.

To avoid send notification mail to old email, try ways follow. (All ways are no working with owner)

Way 1. Set Setup | Manage | User Management | Users
When change the email address, "Generate new password and notify user immediately" checkbox (at the bottom of the edit screen) need to be checked. Then the email address will get committed right away, no more confirmation needed! But obviously the user then gets sent a new password.


Way 2. Change email through Develop console
1.Select user data [select id,email,username from user]
2.Change the target user's email and click [Save Rows]
3.Click [Refresh Grid] to check if email is been changed.
*(2016/09/28) Some license may not working, like "Company Communities".


Way 3. Change email by code
User user = [select id,email from user where id = 'target user id'];
user.email = 'new_email@exmple.com';
update user;
*If use upsert, it will have a error: "DML not allowed on User". No matter if the record already exists or updating or creating new
*(2016/09/28) Some lisence may not working, like "Company Communities"
*(2021/11/5 update) Looks like Salesforce had removed Way 3 completely.

2016-09-08

Bounced email: all failed error mail:#< #5.3.0> #SMTP#

Try to do some test cases, I sent a lot of mails(more than 60) to invalid mail address by mail alert through SFDC workflow.

#Workflow rule: When create an new record, a mail will be sent to the invalid email.

After some a lot failed mail, I sent a mail to available email, but it was failed either.

#Debug log shows mail was sent out by workflow, but I can't find the mail in inbox of "sample@mail.com".

#Get error info from error mail as "sample@mail.com#< #5.3.0> #SMTP#"

As email received succeed just before the test and the mails from salesforce isn't in block list. It should not be the problem in mail setting.

Check Configure Deliverability Settings says:
Bounced email
Email that is addressed to an invalid recipient and returned to the sender. If a sender sends several email messages that bounce, the email server might slow or block the delivery of all email from that sender.
It looks like the reason why mail can't be received. So wait the next day(UTC00:00) and it is fixed.