function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AutobatAutobat 

DMLOption for New User not sending password email in @future

Hey Guys,

 

I have tried the two different options available for setting the DML trigger user email option and still no email is being sent to the new user.  If i open the edit screen the 'Generate New Password and Notify User immediately' is still available.  Any ideas?

 

Approach 1

 

Database.DMLOptions dmo = new Database.DMLOptions();
dmo.EmailHeader.triggerUserEmail = true;
theUser.SetOptions(dmo);
		
database.insert(theUser);

 

 

Approach 2

 

Database.DMLOptions dmo = new Database.DMLOptions();
dmo.EmailHeader.triggerUserEmail = true;
		
database.insert(theUser, dml);

 

 

praveen murugesanpraveen murugesan
I am also facing the same problem.

But in one org it is not working another org the mail is sending perfectly.

Thanks.