customer_unsubscribe
Generates a form for unsubscribing an email or mobile phone.
Params
return_to{String}Redirect URL after form submit, defaults to the current page URL.
Inputs
| input | type | name | required | remarks |
|---|---|---|---|---|
| unsubscribe type | 'email'/'phone' | customer[unsubscribe_type] | yes | |
| unsubscribe reason | enum | customer[unsubscribe_reason] | no | |
| other reason | string | customer[other_reason] | no | custom unsubscribe reason |
Unsubscribe reason enum
| value | meaning |
|---|---|
| 1 | I no longer want to receive these emails |
| 2 | I receive too many emails |
| 3 | I did not subscribe to this list |
| 4 | Emails are not relevant to me |
| 5 | Email content is too long |
| 6 | Other |
Example
{{#form "customer_unsubscribe"}}
<input type="hidden" name="customer[unsubscribe_type]" value="email" />
{{#each form.unsubscribe_reasons}}
<div class="unsubscribe-reason">
<input type="radio" name="customer[unsubscribe_reason]" value="{{value}}" />
<span>{{t text}}</span>
</div>
{{/each}}
<input type="text" maxlength="300" name="customer[other_reason]" value="" />
<div class="submit">
<input class="submit-button" type="submit" value="unsubscribe">
</div>
{{/form}}
Was this article helpful to you?