Subscribe Forms

Last Updated: 28/11/2024     Tags: jquery wrapper, basic usage
  • Switch Version
  • V5
  • V4

Subscribe forms use the subscribe form action, and normally sign entrants up to a designated list then send a welcome email.

An example subscribe form is shown below; this form adds entrants to List ID 5, and then sends Activity ID 144 confirming the entry. First name and email address are collected.

Form submission occurs in the background, and once complete the callback function is called.

<script type="text/javascript">
// Update the Taguchi plugin defaults with the correct values for this campaign
$.fn.tmform.defaults = $.extend($.fn.tmform.defaults, {
    instance: 'edm.taguchimail.com', // set to the client's instance name (<instance>.taguchimail.com)
    list_id: 5, // list ID of the destination list for competition entrants, refer to Taguchi Admin > Subscribers > Lists
    debug: false, // to prevent data being saved to TaguchiMail, change this to true
    bind: 'submit' // remove this line (and the comma on the line above) if no form validation is used
});

$('#subscribeform').tmform({
    action: 'subscribe',
    callback: function () {
        alert("Form submission has completed");
    },
    event_ref: 'up', // ID of the subscribe event
    activity_id: 144  // ID of the Taguchi Activity to send to the new subscriber
});
</script>

<form id="subscribeform" action="" method="post">
    <fieldset>
        <label for="firstname">First Name</label>
        <input type="text" id="firstname" name="subscriber_firstname" title="First Name" />

        <label for="email">Email</label>
        <input type="text" id="email" name="email" title="Email" />

        <input type="submit" name="submit" value="Subscribe" />
    </fieldset>
</form>