This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
Custom email body for just one form, default for others
Started 16 years ago by philipwareham | 3 posts |
- 
		
		
	
		
		
		Hi there, 
 Is there a way to alter the code slightly in helper-function.php so that most emails use the standard template with line 326 as...$email_body = '<table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-family:Lucida Grande,Tahoma,Arial,Verdana,sans-serif;font-size:12px;text-align:left">'."\n"; ...but, say for example, only form 7 uses a customised version of that line with... $email_body = '<img src="/images/my-image-example.gif"/><table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-family:Lucida Grande,Tahoma,Arial,Verdana,sans-serif;font-size:12px;text-align:left">'."\n"; I'm sure this can be done with 'if' conditional statements? But if so, how do I do it? Thanks in advance, 
 PhilPosted 16 years ago #
- 
		
		
		
		
		Yes, that is possible. You can use something like this: if($form_id == 7){ $email_body = '<img src="/images/my-image-example.gif"/><table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-family:Lucida Grande,Tahoma,Arial,Verdana,sans-serif;font-size:12px;text-align:left">'."\n"; }else{ $email_body = '<table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-family:Lucida Grande,Tahoma,Arial,Verdana,sans-serif;font-size:12px;text-align:left">'."\n"; }MachForm Founder Posted 16 years ago #
- 
		
		
	
		
		
		Works great, thanks yuniar Posted 16 years ago #
Reply
You must log in to post.

