UserProfile objUserProfile = new UserProfile(firstname,lastname,profilePicUrl,email);
Add the following code immediately after instantiating the message object:
message = new Mail(); message.Subject = "New User got registered successfully."; message.From = new Email("donotreply@example.com"); message.AddContent(new Content("text/html","Thank you so much for getting registered to our site."));
public class UserProfile : TableEntity { public UserProfile(string lastName, string firstName,string profilePicUrl,string email) { .... .... this.ProfilePicUrl = profilePicUrl; this.Email = email; } .... .... public string ProfilePicUrl {get; set;} public string Email { get; set; } }
Instead of hardcoding, we are passing the values of the Subject, body (content), and From address dynamically via code. It's also possible to change the values and personalize based on the needs. Note that the email will be sent to the end user who got registered by providing an email address.
Let's run a test by adding a new input field email to the test request payload, shown as follows: