<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Forum posts to 'Site Builders'</title>
		<link>http://www.silverstripe.com/site-builders-forum/</link>
		

		
		<item>
			<title>Re: Contact Form - From Address Help</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=142990</link>
			<description>Yup, I had no problem accessing the FormData to be used in the template. &lt;br /&gt;&lt;br /&gt;I have another quick question, a bit off topic. Not to do with this problem, but I'm working on another form.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;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?&lt;br /&gt;&lt;br /&gt;Here is the signup function&lt;br /&gt;&lt;br /&gt;[code]&lt;br /&gt;    function M3SignUp($data, $form) {&lt;br /&gt;        $member = new Member();&lt;br /&gt;        $form-&amp;gt;saveInto($member);        &lt;br /&gt;        $member-&amp;gt;write();&lt;br /&gt; &lt;br /&gt;        if($group = DataObject::get_one('Group', &quot;Code = 'm3-rental-strategy'&quot;)) {&lt;br /&gt;           $member-&amp;gt;Groups()-&amp;gt;add($group);&lt;br /&gt;        }&lt;br /&gt;		&lt;br /&gt;	$email = new Email_Template();&lt;br /&gt;	$email-&amp;gt;ss_template = 'SignUp_Email';&lt;br /&gt;      	$email-&amp;gt;from = 'removed';&lt;br /&gt;      	$email-&amp;gt;to = $data['Email'];&lt;br /&gt;      	$email-&amp;gt;subject = 'Default Newsletter';	  &lt;br /&gt;	$email-&amp;gt;populateTemplate($data);	  &lt;br /&gt;	$email-&amp;gt;send();&lt;br /&gt;&lt;br /&gt;        Director::redirect('/thanks-for-signing-up/');&lt;br /&gt;    }&lt;br /&gt;[/code]&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;Possible?&lt;br&gt;&lt;br&gt;Posted to: Contact Form - From Address Help</description>
			<pubDate>Thu, 14 Aug 2008 13:11:52 +1200</pubDate>
			<author>Liam </author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=142990</guid>
		</item>
		
		<item>
			<title>Re: Contact Form - From Address Help</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=142928</link>
			<description>Great to hear!&lt;br /&gt;&lt;br /&gt;Were you successful using the FormData template control for the email?&lt;br /&gt;&lt;br /&gt;Sean&lt;br&gt;&lt;br&gt;Posted to: Contact Form - From Address Help</description>
			<pubDate>Thu, 14 Aug 2008 09:28:20 +1200</pubDate>
			<author>Sean Harvey</author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=142928</guid>
		</item>
		
		<item>
			<title>Re: Contact Form - From Address Help</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=142334</link>
			<description>Just wanted to update and let you know, the new code does work so everything is running perfectly.&lt;br /&gt;&lt;br /&gt;Only got around to doing it today, as I had to work on other projects.&lt;br&gt;&lt;br&gt;Posted to: Contact Form - From Address Help</description>
			<pubDate>Thu, 14 Aug 2008 05:59:35 +1200</pubDate>
			<author>Liam </author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=142334</guid>
		</item>
		
		<item>
			<title>Re: Contact Form - From Address Help</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=135302</link>
			<description>Not sure why the parameters aren't working properly - could be because it's the Email_Template class instead, but anyways, here's some code which you can replace your doForm() method with:&lt;br /&gt;&lt;br /&gt;http://pastie.org/246883&lt;br /&gt;&lt;br /&gt;Maybe this will work!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br&gt;Posted to: Contact Form - From Address Help</description>
			<pubDate>Mon, 04 Aug 2008 19:28:59 +1200</pubDate>
			<author>Sean Harvey</author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=135302</guid>
		</item>
		
		<item>
			<title>Re: Contact Form - From Address Help</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=133480</link>
			<description>And more updates!&lt;br /&gt;&lt;br /&gt;Okay the user defined forms do work. There was a mix up of SPF records and some other things, along with the email I was sending them to, so ignore the stuff above.&lt;br /&gt;&lt;br /&gt;I've made some progress with with the custom contact form.&lt;br /&gt;&lt;br /&gt;The reason it wasn't sending, was that I had commented out the $dataFieldByName(SecurityID) in the template. As far as I had read, I didn't think it was available in 2.2.2, only trunk which I'm not using for this live site. I've since included it and it works fine, but emails are bouncing. The form sends from a users end point of view, but I get a bounced email saying there was no recipient addresses, so the email obviously couldn't be sent.&lt;br /&gt;&lt;br /&gt;It seems the info in the doForm() function aren't being sent. The &quot;To&quot; and &quot;Subject&quot; field are blank, and the &quot;From&quot; address defaults to the admin email set in my config file, not the different one that is in the doForm() function.&lt;br /&gt;&lt;br /&gt;This is what I gathered from the bounced email that gets sent back to the default address in the config file.&lt;br&gt;&lt;br&gt;Posted to: Contact Form - From Address Help</description>
			<pubDate>Fri, 01 Aug 2008 17:02:50 +1200</pubDate>
			<author>Liam </author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=133480</guid>
		</item>
		
		<item>
			<title>Re: Contact Form - From Address Help</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=133170</link>
			<description>Okay more updates.&lt;br /&gt;&lt;br /&gt;It seems the forms in general don't submit. Testing around on my svn copy of trunk, I changed the contact page to a basic user defined form to test. The submission goes through and is submitted to the database and is shown under the page's 'submissions' tab, but it never emails. So it seems to be something with the forms in general, however I have a newsletter setup and that works. &lt;br /&gt;&lt;br /&gt;Now the custom form you helped me with here is installed on 2.2.2 stable, but I think the problem is for both the svn and stable.&lt;br /&gt;&lt;br /&gt;However, on the same server I have a client site running rc3, and a simple user defined form still works. So it seems the problem is with forms not sending on 2.2.2 or later (trunk), but newsletters do send...odd.&lt;br /&gt;&lt;br /&gt;Any idea how to debug this? This is kind of a show stopper if I'm building sites and can't send form emails. I have my own server, so all client sites will be on the same one. Not sure if it's a server configuration or a problem with 2.2.2. I have set the Email::setAdminEmail() in the config file.&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br&gt;Posted to: Contact Form - From Address Help</description>
			<pubDate>Fri, 01 Aug 2008 05:28:40 +1200</pubDate>
			<author>Liam </author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=133170</guid>
		</item>
		
		<item>
			<title>Re: Contact Form - From Address Help</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=132807</link>
			<description>Hmm Okay I have a test copy of trunk on a server to play around with.&lt;br /&gt;&lt;br /&gt;I took the code we've been using here, the one I put up on pastie.org and installed it fresh on there...Still nothing. The exact same problem.&lt;br /&gt;&lt;br /&gt;I'm not really sure why it works for you, and not me. This is very odd...&lt;br&gt;&lt;br&gt;Posted to: Contact Form - From Address Help</description>
			<pubDate>Thu, 31 Jul 2008 12:38:43 +1200</pubDate>
			<author>Liam </author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=132807</guid>
		</item>
		
		<item>
			<title>Re: Contact Form - From Address Help</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=132772</link>
			<description>That's pretty much what I've done. I've run /db/build?flush=1 after installing the code and assigning the page type to the contact page.&lt;br /&gt;&lt;br /&gt;The form shows up no problem, it's just the submitting it where it chokes. The URL after is /contacts/?executeForm=Form and is just a white page.&lt;br /&gt;&lt;br /&gt;The only thing I can think of is that I'm running 2.2.2 stable, not trunk. Not sure if that has anything to do with it.&lt;br /&gt;&lt;br /&gt;Emails are sending as I setup a custom newsletter after learning forms from this example. Users were subscribed perfectly and some sample newsletter were sent and received.&lt;br&gt;&lt;br&gt;Posted to: Contact Form - From Address Help</description>
			<pubDate>Thu, 31 Jul 2008 11:59:14 +1200</pubDate>
			<author>Liam </author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=132772</guid>
		</item>
		
		<item>
			<title>Re: Contact Form - From Address Help</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=132669</link>
			<description>Hmm, that's odd.&lt;br /&gt;&lt;br /&gt;Here's what I did:&lt;br /&gt;&lt;br /&gt;1. I took your code from here: http://pastie.org/243869&lt;br /&gt;&lt;br /&gt;2. Pasted it into ContactPage.php inside mysite/code, ran db/build?flush=1&lt;br /&gt;&lt;br /&gt;3. Applied ContactPage to any page in the CMS, and viewed the page to show the form.&lt;br /&gt;&lt;br /&gt;4. Tried submitting the form, and it worked fine for me - I put a die('here') at the top of doForm() and it showed that text in the browser after submitting.&lt;br /&gt;&lt;br /&gt;Is this what you're doing as well?&lt;br /&gt;&lt;br /&gt;Here's the code that works for me, copied and pasted back for sanity reasons: http://pastie.org/244406&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Sean&lt;br /&gt;&lt;br&gt;&lt;br&gt;Posted to: Contact Form - From Address Help</description>
			<pubDate>Thu, 31 Jul 2008 09:26:44 +1200</pubDate>
			<author>Sean Harvey</author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=132669</guid>
		</item>
		
		<item>
			<title>Re: Contact Form - From Address Help</title>
			<link>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=132529</link>
			<description>Okay I got the new template up and running perfectly with the new code you showed.&lt;br /&gt;&lt;br /&gt;The form still doesn't submit though. I tried putting in the die() function at the end of the doform function, but it didn't show up. I then tried putting it at the start of the doform() function, and still nothing.&lt;br /&gt;&lt;br /&gt;Here is the code I have in my ContactPage.php http://pastie.org/244292&lt;br /&gt;&lt;br /&gt;It seems like a small error somewhere, but nothing stands out to me.&lt;br&gt;&lt;br&gt;Posted to: Contact Form - From Address Help</description>
			<pubDate>Thu, 31 Jul 2008 07:22:24 +1200</pubDate>
			<author>Liam </author>
			<guid>http://www.silverstripe.com/site-builders-forum/show/127684?showPost=132529</guid>
		</item>
		

	</channel>
</rss>
