Sub topic 11
Consent and Privacy Rules
This chapter assumes you can build the HTML sign-up form from the earlier chapters and know what an email service provider (ESP) does. It covers what the law expects when you collect an email address. It is a working overview, not legal advice. Check the rules that apply to your audience and ask a lawyer when the stakes are high.
Why consent matters
An email address is personal data. Rules such as the EU and UK GDPR, the UK PECR, Canada's CASL, and the US CAN-SPAM Act set conditions for collecting it and for sending marketing to it. The rules differ, but they share the same core ideas.
| Regime | Core expectation for marketing email |
|---|---|
| GDPR (EU/UK) | Clear, freely given, specific, informed opt-in. You must be able to prove it. |
| CASL (Canada) | Express or implied consent, with sender identification and an unsubscribe method. |
| CAN-SPAM (US) | No prior opt-in required, but you must include a working opt-out, a postal address, and honest headers. |
The safest approach is to build for the strictest rule you are likely to meet. Visitors can come from anywhere, so one consistent standard is easier than country-specific forms.
What valid consent looks like
Under GDPR, consent must be:
- Freely given. Do not make it a condition of something unrelated. A lead magnet that only exists as a newsletter incentive is acceptable. Hiding newsletter consent inside a purchase is not.
- Specific. Say what the person will receive, for example "the weekly newsletter", not "updates and offers from us and partners".
- Informed. Name who you are and link to your privacy policy.
- Unambiguous. The visitor takes a clear action. A pre-ticked box does not count.
The checkbox from the HTML chapter already follows this pattern:
<label>
<input type="checkbox" name="consent" value="yes" required>
I agree to receive the weekly newsletter and can unsubscribe at any time.
<a href="/privacy">Privacy policy</a>
</label>The box is unticked, the purpose is stated, and the policy is one click away. Keep the required attribute only when the checkbox is the sole way to subscribe. Never tick it for the visitor.
Record the consent
Consent you cannot prove is weak. When the form is submitted, store a record of:
- The email address.
- The exact consent wording shown, or a version number for it.
- The date and time.
- The form or page URL where it was collected.
- The IP address, if your policy and local law allow it.
Most ESPs store some of this automatically. If you handle the data yourself, save it on the server. Do not trust the browser alone, because a client can send any value.
// Server-side sketch (Node.js, Express-style handler)
function recordConsent(req) {
if (req.body.consent !== 'yes') {
throw new Error('Consent not given');
}
return {
email: req.body.email,
consentText: 'I agree to receive the weekly newsletter',
consentVersion: 'v3',
givenAt: new Date().toISOString(),
source: req.get('Referer') || 'unknown'
};
}Common errors
- Pre-ticked boxes. These are invalid consent under GDPR.
- Bundled consent. One box that covers the newsletter, partner offers, and profiling should be split into separate choices.
- Silent additions. Adding customers or contest entrants to the newsletter without a separate opt-in is a frequent violation.
- Missing unsubscribe. Every email needs an easy opt-out, and you must honor it promptly.
- Pop-ups that hide the notice. A short pop-up still needs the consent statement and privacy link.
Where double opt-in fits
A checked box shows the visitor agreed on your page. It does not prove that the address belongs to them. Double opt-in adds a confirmation email, which gives stronger proof. The next chapter covers it.
Exercise
A site's pop-up has a pre-ticked box reading "Send me news and offers from you and our partners." Name two problems and describe a fix.
Show answer
The pre-ticked box is not an unambiguous opt-in, and the wording bundles several purposes (your news, offers, and partners) into one vague consent. The fix is an unticked checkbox with specific wording, such as "I agree to receive the weekly newsletter", a link to the privacy policy, and a separate optional checkbox if partner offers are really needed. Store the wording and timestamp with the address.