Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-06-2012, 02:32 PM   PM User | #1
freshfitz
New to the CF scene

 
Join Date: Oct 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
freshfitz is an unknown quantity at this point
Need help with a variable in a form

I need to add a variable to a pre made form this site uses smarty theme templates. I added an extra field member_id how do I get $post_data['member_id'] to show up in the body of the email?
I would think I would want ->setContent($post_data['message']['member_id']); but that does not work
I can change ->setContent($post_data['message']; to ->setContent($post_data['member_id']; and it will post the member_id

Code:
$toEmail = $email_arr[$post_data['feedback_to']];
		
		try {
			$msg = app_Mail::createMessage(app_Mail::FAST_MESSAGE)
					->setRecipientEmail($toEmail)
					->setSenderEmail((@$profile_fields['email']) ? $profile_fields['email'] : trim( $post_data['member_email'] ))
					->setSenderName((@$profile_fields['username']) ? $profile_fields['username'] : trim( $post_data['member_email'] ))
					->setSubject($post_data['subject'])
					->setContent($post_data['message']);
					
			app_Mail::send($msg);
		} catch (SK_EmailException $e) {
			if ($e->getCode() == SK_EmailException::WRONG_SENDER_EMAIL_ADDR)
			{
				$response->addError($lang_errors->text('false_email'), "member_email");
				return;
			}
		}
				
		$_SESSION['feedback_to'] = $post_data['feedback_to'];
		$response->redirect( SK_Navigation::href('contact') );
	}
}

Last edited by freshfitz; 11-06-2012 at 02:37 PM..
freshfitz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:25 AM.


Advertisement
Log in to turn off these ads.