View Full Version : Change Contact Us to Newsletter Subscription Form
RuralWeb
14-Aug-2006, 03:00 PM
I dont use the Contact Us form in many of my designs so with V8 code being a little easier to get at I am trying to convert the contact us page into a basic newsletter subscription form. I have got so far see:
http://www.hunterspuddings.co.uk/cgi-bin/mf000001.pl?ACTION=SHOWFORM
I am no expert with scripts so HELP!
What is needed now is to add a subscribe/unsubscribe radio button, change the field names so that they match the titles, change the reply email subject heading to "Newsletter" and make only the email field required.
If it is possible then this would be good for the AUG as an option and improve V8 marketing capabilities.
cdicken
15-Aug-2006, 09:38 AM
I decided to apply my vast Perl programming knowledge to the task :) and have found a way to do this. Please find attached an edited MailForm.pl file (zipped up) for you to copy to your Site1 folder.
Basically all I did was add two custom fields to the email called 'Subscribe' and 'Surname' using the instructions in the advanced user guide. I then customised the 'Contact Us Bulk Area' layout to look as follows:
<form method="post" action="<Actinic:Variable Name="SendMailPageURL"/>">
<input type="hidden" name="RANDOM" value="<actinic:variable name='Random'/>" />
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">
<!-- Hidden field when in trial mode -->
<input type="hidden" name="SHOP" value="<Actinic:Variable Name="HiddenFields"/>" />
</actinic:block>
<actinic:variable Name="ValidationError"/>
<input type="hidden" name="Subject" value="Newsletter" />
<table cellpadding="3" cellspacing="0">
<tr>
<td width="15"> </td>
<td colspan="2">
<strong><Actinic:Variable Name="MailFormHeader"/></strong><br />
<br />
</td>
</tr>
<tr>
<td> </td>
<td>
Forename
</td>
<td>
<input type="text" name="Name" size="50" value="<Actinic:Variable Name="MailFormNameValue"/>" />
</td>
</tr>
<tr>
<td> </td>
<td>
Surname
</td>
<td>
<input type="text" name="Surname" size="50" value="" />
</td>
</tr>
<tr>
<td> </td>
<td>
</td>
<td>
Subscribe: <input type="radio" checked="checked" name="Subscribe" value="yes" /><br />
Unsubscribe: <input type="radio" name="Subscribe" value="no" />
</td>
</tr>
<tr>
<td> </td>
<td>
<span class="actrequired"><Actinic:Variable Name="MailFormEmail"/> *</span>
</td>
<td>
<input type="text" name="EmailAddress" size="50" value="<Actinic:Variable Name="MailFormEmailValue"/>" />
</td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top">
Country:
</td>
<td>
<input type="text" size="50" name="Message" value="<Actinic:Variable Name="MailFormMessageValue"/>" />
</td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top"> </td>
<td>
<input type="submit" name="ACTION" value="<Actinic:Variable Name="MailFormSendButton"/>" />
</td>
</tr>
<tr>
<td valign="top"> </td>
<td colspan="2" valign="top">
<Actinic:Variable Name="RequiredFields"/> <span class="actrequired"><Actinic:Variable Name="Highlighted"/></span>.
</td>
</tr>
</table>
</form>Then go to Design Text and change field ID 2370 to 'First Name' and 2373 to 'Country'.
Good luck!
RuralWeb
15-Aug-2006, 09:44 AM
Hi Chris, Many thanks for that. I saw the info in the V7 user guide but did not know if it would work for V8 - too much room for error with my typing skills!. I will definately be using it on many sites.
RuralWeb
15-Aug-2006, 12:25 PM
Works a treat - well worth adding to the the AUG I think.
cdicken
15-Aug-2006, 03:31 PM
Glad you got it working OK. I was rather pleased to get that Perl working (took a few goes...). I'll add it to the AUG.
uh_vm
03-Jan-2007, 04:42 PM
cdicken,
my site is unitedherbs.co.uk
is it possible to have "Contact Us" and this "script" co-exist on one site?
If so, how do i do it pls?
vincent
cdicken
04-Jan-2007, 10:50 AM
Hi Vincent
This isn't possible I'm afraid. The changes will permenantly add the new fields to the 'Contact Us' page.
You need to maybe look at getting hold of a custom script for doing newsletter subscriptions and then put the <form> code in your overall (outer) layout that you are using for your store design.
uh_vm
04-Jan-2007, 10:59 AM
chris,
i am new to actinic, how do you get to the "contact us" page source code? so that i can do some testing etc.
for example, adding extra option fields, selection fields, radio button etc.
vincent
cdicken
04-Jan-2007, 02:45 PM
Hi there - have you got the Advanced User Guide yet? Step 1 says...
1. Go to the 'Design' tab in the 'Select Page Type' drop-down list select 'Contact Us'.
uh_vm
04-Jan-2007, 05:17 PM
Hi there - have you got the Advanced User Guide yet? Step 1 says...
1. Go to the 'Design' tab in the 'Select Page Type' drop-down list select 'Contact Us'.
hi chris,
pls accept my apology, i mean the actual raw source code, not actinic pre-defined script.
can u help?
cheers
vincent
pinbrook
04-Jan-2007, 05:33 PM
are you asking for the perl script?
if so mailform.pl
uh_vm
04-Jan-2007, 06:44 PM
are you asking for the perl script?
if so mailform.pl
jo, chris,
it could well be - i will need to investigate further over the next couple of day.
many thanks for the pointer, will let you guys know how it turn out.
vincent
absolute-audio
23-Jul-2007, 01:06 PM
This certainly does work a treat and has helped me out no end..
But one thing....
Upon completing a test for both subscribe and unsubscribe, it doesn't say whether or not the person emailing you in signing up or wanting to be removed - can this be addressed?
Bruce
26-Jul-2007, 08:59 AM
Peter,
Apologies for the delay in getting a reply. Do you not get a value of 'Yes' or 'no' come throught with the email.
Kind regards,
absolute-audio
26-Jul-2007, 03:20 PM
Bruce, thanks for your response. The same reply comes back from both emails...
SUBSCRIBE TEST
First Name:Test
Email Address: pete@ultimate-av.co.uk
Country:
UK
UNSUBSCRIBE TEST
First Name:Test2
Email Address: pete@ultimate-av.co.uk
Country:
UK
There are no yes' or no's in the emails at all...
Thanks
absolute-audio
30-Jul-2007, 04:30 PM
Any joy with this yet from anyone at Actinic?
Thanks
Pete
cdicken
31-Jul-2007, 09:43 AM
I think you may have left out the following stages of the fix:
12. Then search for: '# Construct the mail text and send it to the merchant'
13. You need to add a line for each field after:
$sTextMailBody .= ACTINIC::GetPhrase(-1, 2373) . "\r\n" . $sMessage . "\r\n\r\n";
for example:
$sTextMailBody .= "MyNewFieldName:" . $sMyNewField . "\r\n";
In your case it would be
$sTextMailBody .= "Subscription:" . $sSubscribe . "\r\n";
absolute-audio
31-Jul-2007, 09:51 AM
Chris, thanks for this. Do I just need to add the one line for Subscribe or a second one for Unsubscribe as well?
cdicken
31-Jul-2007, 03:52 PM
The one line will cover both situations as '$sSubscribe' is a variable, which will be substituted for whatever the customer selects online.
absolute-audio
31-Jul-2007, 03:54 PM
Will try and report back - thanks Chris
*EDIT* WORKS A TREAT - thanks again
JulesRS
02-Sep-2007, 08:35 PM
Hi,
Further to the previous messages I have been trying to ensure that when a customer subscribes or unsubscribes to the newsletter, the resulting email states their preference.
I have tried to implement the changes in the MailForm.pl file but each time I edit the script to add the information Chris has suggested, I get the following error on the Newsletter Subscription page:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request
I know this is due to an error within the changes I have made within the MailForm.pl file as when I revert it back to the way it was originally the page displays fine. However, I still then have the problem that the emails received don't state whether the customer is subscribing or unsubscribing.
I can't see what I have done wrong, but I have obviously done something incorrectly. I have included the information I have added to the MailForm.pl below (highlighted in bold):
# Construct the mail text and send it to the merchant
#
$sError = ACTINIC::GetPhrase(-1, 2377);
$sTextMailBody .= ACTINIC::GetPhrase(-1, 2370) . $sName . "\r\n";
$sTextMailBody .= ACTINIC::GetPhrase(-1, 2371) . $sEmailRecpt . "\r\n";
$sTextMailBody .= ACTINIC::GetPhrase(-1, 2373) . "\r\n" . $sMessage . "\r\n\r\n";
$sTextMailBody .= "Subscription:" . $sSubscribe . "\r\n";
my @Response = ACTINIC::SendMail($::g_sSmtpServer, $$::g_pSetupBlob{EMAIL}, $sSubject, $sTextMailBody, $sEmailRecpt);
if ($Response[0] != $::SUCCESS)
I have probably misunderstood the instructions and would be grateful if somebody could point me in the right direction.
I have also noticed that the resulting email sent does not include the 'surname' of the customer, only the first name. How do I ensure that all fields are in fact sent on the email?
Thanks,
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.