EKM Tag: [ekm:newsletter]
This tag is used to output an ekmResponse sign up form on your EKM shop.
You must enable the "ekmResponse" feature on your EKM before this tag will output.
- Tag Information
- Styles
- Nesting This Tag
- Using Callbacks
[ekm:newsletter]style='1';[/ekm:newsletter]
[ekm:newsletter]
output_start='';
output_item='[first_name][last_name][email][signup_button]';
output_end='';
textbox_attribute='maxlength="1000"';
firstname_textbox_attribute='value="First Name" class="newsletter-text hide"';
lastname_textbox_attribute='value="Last Name" class="newsletter-text hide"';
email_textbox_attribute='value="Email Address" class="newsletter-text"';
signupbutton_attribute='';
signupbutton_image='';
[/ekm:newsletter]
style='1';
Define the layout for the newsletter signup to be displayed. View All Styles Here
output_start='<div id="newsletter">';
Specify any HTML or Text you want to output before the newsletter fields. This will only be output if the newsletter feature is enabled. Typically here you would output any opening HTML tags and headers.
output_item='[email][signup_button]';
Specify the layout for the form's content. Here you can insert HTML or Text to define the layout of the fields and submit button.
To output the newsletter fields, including additional fields like First and Last name you need to include attribute tags within the output item.
output_end='</div>';
Specify any HTML or Text you would like to output when the newsletter form has finished outputting. Typically here you would close any opened divs from the output_start
attribute.
textbox_attribute='maxlength="1000"';
Specify any input
HTML attributes you would like to apply to the text fields. This will affect the first name, last name and email address.
firstname_textbox_attribute='value="First Name"';
Specify any input
HTML attributes you would like to apply to only the first name field.
lastname_textbox_attribute='value="Last Name"';
Specify any input
HTML attributes you would like to apply to only the last name field.
email_textbox_attribute='value="Email Address"';
Specify any input
HTML attributes you would like to apply to only the email address field.
signupbutton_attribute='';
Specify any input
HTML attributes you would like to apply to only the signup button.
signupbutton_image='/ekmps/shops/mytestshop/resources/Design/signup-button.png';
Specify a path to any image you wish to use as the button.
on_submit='functionName';
These are for advanced use only, see Callback documentation for further information.
Specify the name of a Javascript function with global scope to be called when the user submits the newsletter signup.
on_success='functionName';
These are for advanced use only, see Callback documentation for further information.
Specify the name of a Javascript function with global scope to be called when the user submits the newsletter signup and receives success.
on_failure='functionName';
These are for advanced use only, see Callback documentation for further information.
Specify the name of a Javascript function with global scope to be called when the user submits the newsletter signup and receives a failure.
This tag has a number of predefined layout styles. Below are examples for each of the styles and how they will look on your website.
1
the form style will output like the example below.
[ekm:newsletter]style='1';[/ekm:newsletter]
2
the form style will output like the example below.
[ekm:newsletter]style='2';[/ekm:newsletter]
3
the form style will output like the example below.
[ekm:newsletter]style='3';[/ekm:newsletter]
4
the form style will output like the example below.
[ekm:newsletter]style='4';[/ekm:newsletter]
The EKM system allows for some tags to be nested within other tags.
This section offers documentation on the custom javascript callback responses offered by the newsletter tag. If you do not have a working knowledge of Javascript or Callbacks avoid using these features as it could cause errors and user problems for your site.
[ekm:newsletter]
output_item='[first_name][last_name][email][signup_button]';
on_submit='newsletterSubmit';
[/ekm:newsletter]
<script type="text/javascript">
function newsletterSubmit(email, firstname, lastname){
if (!firstname || !lastname) { alert('You did not enter a first and last name'); return false;}
if (!(/.+@.+\..+/).test(email)) { alert('your email address is invalid'); return false;}
return true;
}
</script>
[ekm:newsletter]
output_item='[first_name][last_name][email][signup_button]';
on_success='newsletterSuccess';
[/ekm:newsletter]
<script type="text/javascript">
function newsletterSuccess(){
alert('You are signed up!');
}
</script>
[ekm:newsletter]
output_item='[first_name][last_name][email][signup_button]';
on_failure='newsletterFailed';
[/ekm:newsletter]
<script type="text/javascript">
function newsletterFailed(message){
alert(message);
}
</script>