Sample email template code

0 comments

Here is an example plain email (with simple html)


	private void SendEmailToCustomer() {
		//send email to candidate
		var tb = new Beweb.TextBlock("Email - Job Apply (mobile)", "Website: Job Application (mobile)",
			@"Dear [--PERSONFIRSTNAME--],

Thanks for completing the first step of the application process. We have your contact details and a consultant will be in touch with you shortly. If you want to fast track the process, please to go to the website. 

Your Details:
	Full Name  : [--PERSONFULLNAME--]
	Email address : [--PERSONEMAIL--]
	
Job Title  : [--JOBTITLE--]
[--JOBDETAILS--]
[--APPLYFORJOBINSTRUCTIONSMOBILE--]

We are reviewing your information, and will contact you shortly.

From the web site.");
		var body = tb.RawBody.Replace("\r\n", "
"); body = body.Replace("", "
"); //replacements body = body.Replace("[--PERSONFIRSTNAME--]", customer.custentity_first_name_passpt); body = body.Replace("[--PERSONFULLNAME--]", customer.FullName); body = body.Replace("[--PERSONEMAIL--]", customer.email); body = body.Replace("[--NSID--]", customer.NetsuiteID + ""); body = body.Replace("[--JOBNSID--]", applyingForJob.NetsuiteID + ""); body = body.Replace("[--JOBTITLE--]", applyingForJob.JobTitle); string jobDetails = Savvy.Site.GetQual(applyingForJob); if (applyingForJob.FullBriefDocumentAttachment.IsNotBlank()) { var urllink = Web.BaseUrl + "download.aspx?file=" + applyingForJob.FullBriefDocumentAttachment; jobDetails += "
Please click here to download the Job brief.
"; } if (applyingForJob.custrecord_jo_lead_rc.HasValue) { var pers = Models.Employee.LoadByNetSuiteID(applyingForJob.custrecord_jo_lead_rc.Value); if (pers != null && pers.IsPublished) { //%> <%=pers.personname> - Edit<% jobdetails="" br="" consultant:="" pers="" personname=""> Email: " + pers.EmailAddress + ""; jobDetails += "
Skype: " + pers.SkypeAddress + ""; jobDetails += "
Telephone number: " + pers.TelephoneNumber + ""; jobDetails += "
"; } } body = body.Replace("[--JOBDETAILS--]", jobDetails); body = body.Replace("[--APPLYFORJOBINSTRUCTIONSMOBILE--]", applyingForJob.ApplyForJobInstructionsMobile); body = body.Replace("[--CREATEDATE--]", Fmt.DateTime(DateTime.Now)); var em = new ElectronicMail() { ToAddress = customer.email, Subject = tb.Title, BodyHtml = body }; if (!em.Send(false)) { //mail failed ErrorMessage = "Failed to send confirmation email"; } }

Comments


Leave a Comment