17488 Posts in 4473 Topics by 1978 members
|Go to End|
29 October 2007 at 12:47pm
I'm looking for solution how to add custom email template on user defined form ( contact form ) submits .
When form is emailed it looks like it using Page.ss which is bad for me:)
How to add customized template for emailed submitted user form?
29 October 2007 at 3:07pm
There's 2 solutions:
1. You make a contact form in code, rather than use the 'contact form' in the CMS - this way you get full control over making it. See the 3rd tutorial for more information on this.
2. Subclass UserDefinedForm, and hack the code so it chooses a different template. (Not the best solution).
30 October 2007 at 10:30pm
can u help to place dropdown controls from middle of the page ... help me please
30 October 2007 at 11:10pm
OK, I used http://doc.silverstripe.com/doku.php?id=email_template end works almost perfect but there are three problems:
1. How to add translated validation messages? Page is in Polish and have to translate validation messages
2. How to add proper encoding to email? I have bad characters when email is submitted
3. How to add confirmation message that the email has been send
function doContactForm ( $data, $form )
$submission = new ContactFormSubmission();
// send email
$email = new Email_Template();
$email->ss_template = "ContactFormEmail";
$email->subject = $submission->val( "Subject" );
$email->from = $submission->val("Email");
$email->to = "email@example.com";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<p>WiadomoÃ…â€ºÃ„â€¡ wysÃ…â€šana przez $Name z formularza kontaktowego:</p>
30 October 2007 at 11:48pm
Ok now I need only two answers:)
3. How to add confirmation message that the email has been send?
I had to add SubmittedContactArticlePage.ss and works perfect:)
31 October 2007 at 9:43am
Just before Director::redirectBack() you can call:
$form->sessionMessage('Thanks, you've been signed up', 'good');
1 November 2007 at 12:09am
Are there some messages like 'good' for replacing validation messages?
|Go to Top|