Yup, I had no problem accessing the FormData to be used in the template.
I have another quick question, a bit off topic. Not to do with this problem, but I'm working on another form.
I wrote a newsletter sign up form, and upon sign up, the system sends the default newsletter to the user. There is basically only one newsletter for now, so it's easier just to send it to them auto and store their email for later use.
How do I access the $UnsubscribeLink variable in the template so I can include this link in the first email that gets sent, after they sign up?
Here is the signup function
function M3SignUp($data, $form) {
$member = new Member();
$form->saveInto($member);
$member->write();
if($group = DataObject::get_one('Group', "Code = 'm3-rental-strategy'")) {
$member->Groups()->add($group);
}
$email = new Email_Template();
$email->ss_template = 'SignUp_Email';
$email->from = 'removed';
$email->to = $data['Email'];
$email->subject = 'Default Newsletter';
$email->populateTemplate($data);
$email->send();
Director::redirect('/thanks-for-signing-up/');
}
Right now I'm just linking to domain.com/unsubscribe/ so the user can enter the info manually, but I'd like the variable to make it auto.
Possible?