diff --git a/context/skills/migrate-email/references/3-inventory.md b/context/skills/migrate-email/references/3-inventory.md index cc3c6303..bf3baa27 100644 --- a/context/skills/migrate-email/references/3-inventory.md +++ b/context/skills/migrate-email/references/3-inventory.md @@ -56,8 +56,6 @@ A field set to an empty value, such as `""`, `[]`, `{}`, or `null`, or to its of When the code passes a value you can't read, such as a list of recipients built at run time, follow it to its callers. When it comes from an environment variable or a config value, read it from the config, or ask the person once what it holds in production. An example env file names the variable, but its value is often a placeholder: trust it only when it is clearly the deployed value. When you still can't tell, the site stays, and the reason says what you could not check. -For a template the person asks to make in PostHog, a value that the provider template tests or loops over, which `mapping.md` needs to be a boolean or a list, must have that type at run time: the code builds it, such as a literal or a value it computes, or checks it, such as with a schema or a parse. A type the code only declares, such as a TypeScript type or a cast, checks nothing at run time. When the value comes from request input, a file, or another service without such a check, such as `req.body`, the site stays, and the reason is ` is not checked to be a `: the provider's template and Liquid can render a value such as `0` or `""` differently. - A site stays when no sender can be verified for its `from`: an address on a free mail domain, such as `gmail.com` or `outlook.com`, on the provider's shared or sandbox domain, on a domain whose DNS records the person can't publish, such as a school's or another company's, or taken from a user, a customer, or a tenant at run time. The reason names the address or where it comes from. When a site that is not a `template` site sets no `from`, the provider sent from the account's default sender: ask the person for that address once, and the site stays when they can't name it. Unless the provider's `account.md` says it keeps no suppression list, ask the person once, for the sites the checks above leave moving, which of them they rely on that list to stop mailing an address someone added to it, by hand in the provider's dashboard or with a call the app makes, such as an unsubscribe handler. PostHog blocks a moved send only to an address that hard-bounced, so a moved send reaches such an address, whenever it was added. Each site they name stays, and the reason is `relies on 's suppression list`. When they can't tell or don't answer, every such site stays with that reason. Write `to move: the app keeps its own record of those addresses, the ones added before included, and skips them before the send` in the note of each site that stays with that reason, under the sites table, for the report. @@ -68,17 +66,25 @@ Ask the person once, listing every other template the sites send, with the plan Each template that moves needs its content to be checked. Read the provider's `account.md`, and ask the person once for every such template: copies from the dashboard that they save in files outside the repository and tell you where, or a read through the API, where `account.md` says the API returns the content. Check each one as `template-to-code.md` says under "Check", with the provider's `mapping.md` under "Templates". When the person can't give the content, the site stays, and the reason is `template content not checked`. A template whose check fails stays, and the reason names the part that keeps it. Write the site's `from` column with the address the send uses: the call's own `from` when it sets one, and the template's sender otherwise, so Step 4 sets up a sender for its domain, and classify that address as any other `from`. -### A template in PostHog, when the person asks for one +### Opens the provider didn't track -A template the person asks to make in PostHog moves in the template form, by its template ID, and the person makes that template: never make one yourself. Its content needs the same check, against the part of `mapping.md` on templates made in PostHog. Ask them once, for every such template, to make it in PostHog from the provider's template and give you its template ID and the address it sends from, usually the provider template's sender. PostHog makes a template transactional only once a verified sender covers its address: ask them to make it transactional now when the project has one, and otherwise once Step 4 verifies the sender. When the email carries a login code, a reset link, or another secret, ask them to mark the template sensitive, as `mapping.md` says. Ask them the same when the provider didn't track the site's clicks, or nobody knows whether it did, as the provider's `account.md` says: PostHog sends each link of a template that is not marked sensitive through its click redirect, which those links never went through. Tell them that a sensitive template keeps no copy of each sent email's body or filled-in subject. When they don't mark it, the site stays, and the reason is `click tracking off`, or `click tracking not checked` when nobody knows. The report lists both before cutover either way. For a template that must be marked sensitive, for a secret in the email or for its clicks, write `must be marked sensitive: ` in its note under the sites table, so the report's "Before cutover" list checks it. Tell them how its placeholders change, as that part of `mapping.md` says. Quote every Liquid string with single quotes, such as `default: 'there'`: PostHog's email builder saves the template as JSON, which escapes double quotes, and the template then fails with a `TokenizationError`. A fallback or a compared value that holds a `'` keeps the template on the provider. Record each template ID with its site under the sites table, and write the address in the site's `from` column. A template without an ID stays, and the reason is `PostHog template not made yet`. +PostHog adds its open pixel to every email it sends unless the send turns its `opens` switch off, as Step 7 says. Once you know each site's sender, check for each site that nothing else keeps on the provider whether the provider tracked the opens of its emails, with an open pixel in each one, as the provider's `account.md` says. Never ask the person whether PostHog may add its pixel: the site moves either way. -### Opens the provider didn't track +- When a site's emails had no open pixel, because the provider never tracks opens, or open tracking was off or never set up, the site moves with opens off. Write `opens off: didn't track its opens` in its note under the sites table. +- When nobody can tell whether the provider tracked a site's opens, the site moves with opens off too, so PostHog adds no pixel the old emails may not have had. Write `opens off: open tracking not checked` in its note. A site whose emails a webhook handler acts on for the provider's open event, such as `email.opened` in Resend or `open` in SendGrid, stays instead, and the reason is `open tracking not checked`: with opens off, PostHog sends no opened events in place of the provider's. +- When the provider tracked the site's opens, the site moves with nothing to note. + +A send by template ID can't set tracking, so a site where tracking matters never moves to a template made in PostHog, even when the person asked for one: + +- A site with opens off moves into the code, where `tracking` turns `opens` off, as Step 7 says. When it can't, it stays, and the reason is `opens off needs a code send`. +- A site whose open tracking changes from send to send, such as SendGrid's `openTracking` with `enable: !recipient.optedOut`, stays, and the reason is `open tracking set at run time`. +- A site whose emails a webhook handler acts on for the provider's click event stays, and the reason is `its clicks feed a webhook handler`: Step 7 never tracks a code send's clicks. + +### A template in PostHog, when the person asks for one -PostHog adds its open pixel to every email it sends, in the code form and from a template made in PostHog alike. Check this for each site that nothing else keeps on the provider, as the provider's `account.md` says: whether the provider tracked the opens of its emails, with an open pixel in each one. +The checks under "Opens the provider didn't track" come first. A template the person asks to make in PostHog moves in the template form, by its template ID, and the person makes that template: never make one yourself. Its content needs the same check, against the part of `mapping.md` on templates made in PostHog. Ask them once, for every such template, to make it in PostHog from the provider's template and give you its template ID and the address it sends from, usually the provider template's sender. PostHog makes a template transactional only once a verified sender covers its address: ask them to make it transactional now when the project has one, and otherwise once Step 4 verifies the sender. When the email carries a login code, a reset link, or another secret, ask them to mark the template sensitive, as `mapping.md` says. Ask them the same when the provider didn't track the site's clicks, or nobody knows whether it did, as the provider's `account.md` says: PostHog sends each link of a template that is not marked sensitive through its click redirect, which those links never went through. Tell them that a sensitive template keeps no copy of each sent email's body or filled-in subject. When they don't mark it, the site stays, and the reason is `click tracking off`, or `click tracking not checked` when nobody knows. The report lists both before cutover either way. For a template that must be marked sensitive, for a secret in the email or for its clicks, write `must be marked sensitive: ` in its note under the sites table, so the report's "Before cutover" list checks it. Tell them how its placeholders change, as that part of `mapping.md` says. Quote every Liquid string with single quotes, such as `default: 'there'`: PostHog's email builder saves the template as JSON, which escapes double quotes, and the template then fails with a `TokenizationError`. A fallback or a compared value that holds a `'` keeps the template on the provider. Record each template ID with its site under the sites table, and write the address in the site's `from` column. A template without an ID stays, and the reason is `PostHog template not made yet`. -- When a site's emails had no open pixel, because the provider never tracks opens, or open tracking was off or never set up, ask the person once, for all such sites together, whether PostHog may add its open pixel to emails that never had one. Yes: those sites move, and the report says that PostHog now counts their opens. No, or no answer: they stay, and the reason is `open tracking off`. -- When nobody can tell whether the provider tracked a site's opens, the site stays, and the reason is `open tracking not checked`. -- For each site that moves with the person's yes, write `open pixel added: the person agreed` in its note under the sites table, so the report names it. +A value that the provider template tests or loops over, which `mapping.md` needs to be a boolean or a list, must have that type at run time: the code builds it, such as a literal or a value it computes, or checks it, such as with a schema or a parse. A type the code only declares, such as a TypeScript type or a cast, checks nothing at run time. When the value comes from request input, a file, or another service without such a check, such as `req.body`, the site stays, and the reason is ` is not checked to be a `: the provider's template and Liquid can render a value such as `0` or `""` differently. ## Write the plan file @@ -106,7 +112,7 @@ A sites table, one row per site, in source tree order: `moves` is `yes` or `no`. `reason` is empty when the site moves. -Under the table, for each `template` site that moves, note its provider template's ID or name, whether it moves into the code or to a template made in PostHog, and where its content is: the person's copy, or the temporary file of the API answer. For a template made in PostHog, add its template ID, and `must be marked sensitive: ` when Step 3 says it must be. For any site that moves with an open pixel its emails never had, note `open pixel added: the person agreed`, as Step 3 says under "Opens the provider didn't track". For each site that stays because it relies on the provider's suppression list, note what would let it move, as Step 3 says after the sender check. +Under the table, for each `template` site that moves, note its provider template's ID or name, whether it moves into the code or to a template made in PostHog, and where its content is: the person's copy, or the temporary file of the API answer. For a template made in PostHog, add its template ID, and `must be marked sensitive: ` when Step 3 says it must be. For any site that moves with opens off, note `opens off: `, as Step 3 says under "Opens the provider didn't track". For each site that stays because it relies on the provider's suppression list, note what would let it move, as Step 3 says after the sender check. In any step, when the provider's `mapping.md` or `account.md`, or a rewrite file, says to note something for the report's "Before cutover" list, write it under the table as a note that starts with `before cutover:`, such as `before cutover: enable ext-curl where the app runs`. When a later step undoes what a note is about, such as an SDK install that Step 7 undoes under "Set up the SDK", it deletes the note. Step 9 lists each note left. diff --git a/context/skills/migrate-email/references/7-rewrite.md b/context/skills/migrate-email/references/7-rewrite.md index 795638b8..a0c5e0ba 100644 --- a/context/skills/migrate-email/references/7-rewrite.md +++ b/context/skills/migrate-email/references/7-rewrite.md @@ -22,7 +22,8 @@ Read the rewrite file of each language that has a site that moves, and only thos ## What every SDK's send takes and answers -- Each call sends one email to one `to` address, in one of two forms. The code form takes a template key, a subject, and HTML, text, or both, with an optional from address, reply-to addresses, and engagement capture, which is on unless the send turns it off. The template form takes a template ID with optional template data, for a template made in PostHog, and none of the code form's fields. +- Each call sends one email to one `to` address, in one of two forms. The code form takes a template key, a subject, and HTML, text, or both, with an optional from address, reply-to addresses, sensitive flag, and tracking. The template form takes a template ID with optional template data, for a template made in PostHog, and none of the code form's fields. +- The code form's sensitive flag and tracking decide what PostHog tracks and keeps for the email, as "Sensitive emails and tracking" below says. The template form takes neither. - Both forms take a distinct ID and an idempotency key. - No SDK takes `cc`, `bcc`, attachments, headers, tags, a send time, or several `to` addresses yet. The provider's `mapping.md` keeps a site that sets one. - The message ID in the answer is PostHog's, not the provider's. It is a UUID, as a string of 36 characters such as `0b9f6d2e-3c1a-4f8e-9a7b-5d2c1e0f4a6b`, so a column or field that holds a UUID takes it. @@ -31,6 +32,26 @@ Read the rewrite file of each language that has a site that moves, and only thos - Every SDK retries network errors and rate limits by itself, with the same idempotency key. A network error that is left after the retries comes back as the same error type as an API error, with the code `network_error`. - A bad argument fails before any request: as the language's argument error, or as the email error with a code that starts with `invalid_`. The rewrite file says which. +## Sensitive emails and tracking + +A code send can be marked sensitive, for an email that carries login links, reset tokens, or codes. A sensitive email keeps its links unchanged unless tracking turns clicks on, leaves its subject off engagement events, and keeps its content out of PostHog's logs. The flag takes true or false. Left out, the send takes the setting of the template in PostHog with the same key, and is sensitive when no template has that key. + +A code send takes tracking as on, off, or a set of switches named `opens`, `clicks`, and `engagement`, under the names the rewrite file gives: + +| Tracking | Opens | Clicks | Engagement events | +| --- | --- | --- | --- | +| Left out | On | Off when sensitive, on when not | On | +| On | On | On | On | +| Off | Off | Off | Off | +| Switches | `opens`, on by default | `clicks`, by default as left out | `engagement`, on by default | + +- Opens adds PostHog's open pixel to the email. Clicks rewrites the email's links to go through a tracking redirect. Engagement captures the email's engagement events on the recipient's person. When the project's **Capture email engagement events** setting is off, PostHog captures none, whatever the send sets. +- Clicks follow the sensitive flag when tracking doesn't set them, because PostHog can't tell a newsletter from an email with a sign-in or password reset link. A tracked link goes through a redirect, so a token in the link would go through it too. A `clicks` switch that the send sets wins over the sensitive flag. +- The sensitive flag doesn't change opens or engagement events. +- Off means PostHog can't count the email's opens and clicks, and captures no engagement events for it. +- PostHog refuses the `clicks` switch on with `opens` off, because click tracking needs open tracking. With `opens` off and `clicks` left out, PostHog tracks no clicks, whatever the sensitive flag says. It refuses an unknown switch too. +- The SDK's engagement capture field, such as `capture_engagement`, is deprecated in favor of the `engagement` switch. A send that sets both is refused. Never write the old field. + ## Status ``` @@ -49,8 +70,9 @@ Read the rewrite file of each language that has a site that moves, and only thos Install the SDK as the rewrite file says under "Install" when the app doesn't have it. Early releases of an SDK may not send email, or may send only a template made in PostHog. Check the installed version for what the moving sites need, and upgrade it to its latest release, as the rewrite file says, only when it lacks one of these: - a site with `html`, `text`, or a component, and a `template` site that moves into the code: the send takes a template key with a subject and an HTML or text body; -- a site with rendered content whose email carries a login code, a reset link, or another secret: the send takes a sensitive flag; -- each other field a site sets, such as a reply-to address or engagement capture: the send takes it; +- each other field a site sets, such as a reply-to address: the send takes it; +- a site that moves to a code send with `opens off` in its plan note: the send takes tracking; +- a site that moves to a code send: the send takes the sensitive flag; - the client: the client options take the provider name, under the name the rewrite file gives. Before you install or upgrade an SDK, check the release you install against every server whose build installs the dependency manifest it goes into, directly or through a workspace or a root lockfile install, such as one `requirements.txt` or `package.json` that two images build on different versions, or that a server and an edge function share. Compare what the registry lists for that release, such as `engines` for `posthog-node` or `Requires-Python` for `posthog`, with the language version each such server runs in production, from its version files, Dockerfile base image, or hosting config. When you can't tell a version, ask the person. When the release doesn't support one of those servers, every moving site whose code installs from that manifest stays, an edge site too, since the install would reach that server: an older runtime can lack what the SDK needs, such as `crypto.randomUUID()` in Node.js, and every send fails, and a strict package manager fails the build. Mark each of their rows `moves: no — the app runs , which doesn't support`. Otherwise, a site on an edge runtime, such as Cloudflare Workers or Vercel Edge Functions, which has no Node.js version of its own, moves only when the rewrite file names that runtime as one the SDK supports, and its row is otherwise `moves: no — doesn't name as a runtime it supports`. Tell the person about each row that stays for this, and go on with the rest. @@ -76,7 +98,7 @@ Configure a server-side client of its own for email in each language that has a ## Link emails to your users -PostHog records each send, and its sent, opened and clicked events when engagement capture is on, against the person the send names with its distinct ID. Pass the ID the app already passes to `identify()`: +PostHog records each send, and its engagement events, such as sent, delivered and opened, when the project's **Capture email engagement events** setting is on and the send's tracking doesn't turn engagement off, against the person the send names with its distinct ID. Pass the ID the app already passes to `identify()`: - Find the app's identify call, such as `posthog.identify(user.id)` in posthog-js, or the distinct ID of its server-side PostHog captures. - At each site, pass the same ID for the recipient, such as `user.id`. The SDKs take the distinct ID as a string, so a numeric ID is passed as its string, such as `String(user.id)` in Node.js and `str(user.id)` in Python, the same string the app's identify call sends. Follow the recipient back through the callers when the site only has the address. @@ -91,7 +113,6 @@ For each site that moves, in plan order: - Rewrite the call as the provider's `mapping.md` says, for the site's language and content form: `html` and `text` content, a component the app renders, a provider template brought into the code, or a template made in PostHog. Write the PostHog send as the rewrite file says under "The send". - For a provider template that moves into the code, read the rest of `template-to-code.md` first. Write its email from the content Step 3 checked, render it at the site, and send the result in the code form, with the subject, `from`, and reply-to address the provider template set. Then delete the temporary copy of its content. - Give each send with rendered content a template key that names the kind of email, such as `welcome` or `password-reset`, with letters, digits, `-`, and `_` only. Two sites that send the same email share a key, in any language. A send whose key a template saved in PostHog already has goes out through that template's settings, and fails when that template isn't transactional. The PostHog MCP doesn't list template keys, so ask the person once, for all the keys together, whether a template in the project already has any of them, and give each such send another key. -- A send with rendered content whose email carries a login code, a reset link, or another secret sets the send's sensitive flag, as the rewrite file names it under "The send". Without it, a send whose key matches a template saved in PostHog takes that template's setting, which is off by default, and PostHog then sends the email's links through its click redirect and puts its subject on engagement events. A send by template ID takes no sensitive flag: PostHog refuses it, and the template made in PostHog holds that setting, as Step 3 asks. - A site that moves to a template made in PostHog sends the template ID the person gave in Step 3, never one you guess. - Keep the site's idempotency key, error branches, logging, and return value working as before. Keep the code around the send unchanged where you can. - Keep the site failing the same way it did. The rewrite file says under "The answer" how its SDK reports an error: Node.js answers `{ data, error }` and never throws on an API error, and the other languages raise or return an error value. When the old call threw on an error, or the code checked a status, check PostHog's error so the site fails the same way, as the provider's `mapping.md` says under "Rewrite". @@ -104,10 +125,13 @@ For each site that moves, in plan order: - A branch on the provider's answer to an invalid send, such as a `400` or a `422`, becomes a branch on PostHog's error name `validation_error`, never on a status code: PostHog's statuses for invalid sends differ from the provider's, and `recipient_suppressed` is a `validation_error` with status `422`. Handle `recipient_suppressed` before that branch, as the provider's `mapping.md` says. - A branch on the provider's rate limit, such as a retry, a wait, or a re-queue on status `429`, becomes a branch on PostHog's status code `429` with a code other than `quota_limited`. PostHog answers a used-up sending quota with status `429` and the code `quota_limited`, which no retry fixes: it takes the path of every other error. - When the old code handled the provider's answer to a bad value that the app passes at run time, such as an empty recipient, also catch the argument error that the rewrite file names, or check the value before the send. -- Never add a field that the old call didn't set, apart from the template key, the template ID, the distinct ID, the sensitive flag on a send with rendered content that carries a secret, the subject, body, `from`, and reply-to address that a provider template brought into the code held, and a field that the provider's `mapping.md` or this step says to add because the old send behaved that way without setting it, such as no retries for a request that kept its own deadline. Open or click tracking never adds one: engagement capture decides only whether the email's events land on the recipient's person, and PostHog adds its open pixel either way, so a site whose emails had none moves only with the person's yes, as Step 3 says under "Opens the provider didn't track". It sends each link through its click redirect only when the email is not sensitive, and a send in the code form is sensitive, since no template saved in PostHog has its key, as the rule on keys above makes sure, so PostHog counts its opens and no clicks. For a template made in PostHog, the template data takes the place of the provider's template variables. For a template brought into the code, the code renders them, and the send has no template data. +- When the site's plan note says `opens off`, because its emails had no open pixel or nobody could tell whether they had one, as Step 3 says under "Opens the provider didn't track", and the site moves to a code send, turn off the `opens` switch only, as the rewrite file shows. Never ask the person about it. PostHog then tracks no clicks either, and engagement events stay on. Never send tracking off, because off turns off engagement events too. Leave tracking out of every other code send. A site that moves to a template made in PostHog sends no tracking, because the template uses its own setting. +- Mark every code send sensitive, as the rewrite file shows. A send that leaves the flag out takes the setting of a template in PostHog with the same key, which is off by default, and you can't see the project's templates or tell whether a link carries a token. The flag keeps the email sensitive whatever key it shares. It also carries over an old send that turned off link or click tracking for that one email, or that marked it as sensitive, better than turning off the `clicks` switch would: it also keeps the subject off engagement events and the content out of PostHog's logs. A site that moves to a template made in PostHog sends no sensitive flag, because PostHog refuses it on a send by template ID and the template uses its own setting: note it for the report, so the person checks that the template has **Protect sensitive data** on when the email carries a secret. +- Never turn on the `clicks` switch, and never mark a send as not sensitive, even when the provider tracked clicks: you can't tell whether a link carries a token. Note each such site for the report, so the person can turn `clicks` on, with opens on, for an email whose links are safe to rewrite, and keep the sensitive flag. A send with `opens` off counts no clicks either way until opens are on too: PostHog refuses `clicks` on with `opens` off. +- Never add a field that the old call didn't set, apart from the template key, the template ID, the distinct ID, tracking with `opens` off, the sensitive flag set to true, as above, the subject, body, `from`, and reply-to address that a provider template brought into the code held, and a field that the provider's `mapping.md` or this step says to add because the old send behaved that way without setting it, such as no retries for a request that kept its own deadline. For a template made in PostHog, the template data takes the place of the provider's template variables. For a template brought into the code, the code renders them, and the send has no template data. When a site turns out to need something `mapping.md` keeps on the provider, undo its change, set `moves` to `no` with the reason, delete the temporary copy of its template content when no other moving site sends that template, and go on. ## Write down -Delete each temporary copy of template content that is still there. Tick the phase in the plan: `- [x] rewrite — sites moved`. Add a `key` column to the sites table with each moved site's template key, or its template ID for a template made in PostHog. Write down each email brought into the code, as `template-to-code.md` says under "Write down". Under the table, note each site without a distinct ID, each fallback that an empty string now replaces, each site that got a branch for a suppressed recipient, each idempotency key a retry across the deploy could send twice, each value the move changed, such as a recipient name the To line loses, each new dependency, each upgraded one with its old and new version, and each new env variable name. +Delete each temporary copy of template content that is still there. Tick the phase in the plan: `- [x] rewrite — sites moved`. Add a `key` column to the sites table with each moved site's template key, or its template ID for a template made in PostHog. Write down each email brought into the code, as `template-to-code.md` says under "Write down". Under the table, note each site without a distinct ID, each fallback that an empty string now replaces, each site that got a branch for a suppressed recipient, each site that sends with `opens` off and why, each template site whose plan note says `opens off` or whose old send marked the email sensitive, each site whose provider tracked clicks that PostHog now doesn't count, each idempotency key a retry across the deploy could send twice, each value the move changed, such as a recipient name the To line loses, each new dependency, each upgraded one with its old and new version, and each new env variable name. Say that every code send is marked sensitive, so PostHog counts its clicks only once the person turns `clicks` on, with opens on, for an email whose links are safe to rewrite. diff --git a/context/skills/migrate-email/references/9-report.md b/context/skills/migrate-email/references/9-report.md index 235ae0da..c7913356 100644 --- a/context/skills/migrate-email/references/9-report.md +++ b/context/skills/migrate-email/references/9-report.md @@ -29,7 +29,7 @@ Read `.posthog-email-migration-plan.md`. Write `posthog-migrate-email- ", or "Stays on : ".> - + ## Other calls @@ -37,7 +37,7 @@ Read `.posthog-email-migration-plan.md`. Write `posthog-migrate-email- ## Webhook handlers - events it handles, and the PostHog events that take their place for the moved sends, from `mapping.md` under "Webhooks". Say that the handler keeps getting events for the sites that stay, that moved sends no longer reach it, that PostHog records their events on the person only when engagement events are on for the project, that a send in the code form counts no clicks, and that a webhook destination in PostHog (Data pipelines, then Destinations) can post those events to an endpoint, in PostHog's shape, not the provider's.> + events it handles, and the PostHog events that take their place for the moved sends, from `mapping.md` under "Webhooks". Say that the handler keeps getting events for the sites that stay, that moved sends no longer reach it, that PostHog records their events on the person only when engagement events are on for the project, that a moved send in the code form counts no clicks until the person turns its `clicks` switch on, with opens on, for an email whose links are safe to rewrite, and that a webhook destination in PostHog (Data pipelines, then Destinations) can post those events to an endpoint, in PostHog's shape, not the provider's.> ## Sender and DNS diff --git a/context/skills/migrate-email/references/resend/account.md b/context/skills/migrate-email/references/resend/account.md index 842eb748..cf3e826a 100644 --- a/context/skills/migrate-email/references/resend/account.md +++ b/context/skills/migrate-email/references/resend/account.md @@ -34,11 +34,11 @@ Read the person's copies where they saved them. An API answer goes only into the ## Open tracking -Resend tracks opens per sending domain, only when open tracking is on for it: Domains, then the domain, then Configuration. Ask the person once, for each sending domain of the sites that move, whether open tracking is on. Off means the site's emails had no open pixel, and no answer means nobody knows whether they had one, as Step 3 says under "Opens the provider didn't track". +Resend tracks opens per sending domain, only when open tracking is on for it: Domains, then the domain, then Configuration. Ask the person once, for each sending domain of the sites that move, whether open tracking and click tracking are on, in one question: this asks about Resend's settings, never whether PostHog may add its pixel. For opens, off means the site's emails had no open pixel, and no answer means nobody knows whether they had one: either way the site moves with opens off, as Step 3 says under "Opens the provider didn't track". ## Click tracking -Resend tracks clicks per sending domain, only when click tracking is on for it: Domains, then the domain, then Configuration. When a site moves to a template made in PostHog, ask the person once, for each sending domain of such sites, whether click tracking is on. Off means Resend didn't track the site's clicks, and no answer means nobody knows, as Step 3 says under "A template in PostHog". +Resend tracks clicks per sending domain, only when click tracking is on for it: Domains, then the domain, then Configuration. The question under "Open tracking" asks about it too. Off means Resend didn't track the site's clicks, and no answer means nobody knows. A site that moves to a template made in PostHog uses the answer as Step 3 says under "A template in PostHog". A code send counts no clicks in PostHog, so when the domain tracks clicks, note in the plan and the report that PostHog doesn't count these emails' clicks, as `mapping.md` says. ## Suppression list diff --git a/context/skills/migrate-email/references/resend/mapping.md b/context/skills/migrate-email/references/resend/mapping.md index 1fa1d5f1..35c9be96 100644 --- a/context/skills/migrate-email/references/resend/mapping.md +++ b/context/skills/migrate-email/references/resend/mapping.md @@ -84,7 +84,7 @@ An email that carries a login code, a reset link, or another secret needs its Po ## Webhooks -Resend stops sending email events for a site that moves. PostHog records the events of a moved send on the person it names with `distinctId`, when engagement capture is on: +Resend stops sending email events for a site that moves. PostHog records the events of a moved send on the person it names with `distinctId`, when the project's **Capture email engagement events** setting is on and the send's tracking doesn't turn engagement off, as Step 7 says under "Sensitive emails and tracking": | Resend event | PostHog event | |---|---| @@ -93,12 +93,12 @@ Resend stops sending email events for a site that moves. PostHog records the eve | `email.bounced` | `$workflows_email_bounced` | | `email.complained` | `$workflows_email_blocked` | | `email.opened` | `$workflows_email_opened` | -| `email.clicked` | `$workflows_email_link_clicked`, only for a template made in PostHog that is not marked sensitive. PostHog treats a send in the code form as sensitive when no template saved in PostHog has its key, which Step 7 makes sure: its links go out as they are, and it counts no clicks | +| `email.clicked` | `$workflows_email_link_clicked`, only when PostHog tracks the email's clicks: for a template made in PostHog that is not marked sensitive and with tracking on, or a code send whose tracking leaves clicks on, as the table in Step 7 under "Sensitive emails and tracking" says. Step 7 marks every code send sensitive and never turns `clicks` on, so its links go out as they are, and PostHog counts no clicks | | Every other email event, such as `email.delivery_delayed` | none | PostHog's events carry no Resend `email_id` and no `tags`. A site whose events a handler matches by `email_id` or by a tag stays on Resend. For every other handler, the report tells the person which events it handles, which PostHog events take their place, and that a webhook destination in PostHog (Data pipelines, then Destinations) can post them to an endpoint. The handler itself keeps working for the sites that stay. Never change it. -A site whose emails a handler acts on for an event that has no PostHog event in the table, such as `email.delivery_delayed`, stays, and the reason is `its events feed a webhook handler`. A site whose emails an `email.clicked` handler acts on moves only to a template made in PostHog that is not marked sensitive, since a send in the code form counts no clicks. Otherwise it stays, and the reason is `its clicks feed a webhook handler`. +A site whose emails a handler acts on for an event that has no PostHog event in the table, such as `email.delivery_delayed`, stays, and the reason is `its events feed a webhook handler`. A site whose emails an `email.clicked` handler acts on stays, and the reason is `its clicks feed a webhook handler`, as Step 3 says under "Opens the provider didn't track". ## Calls that change the suppression list @@ -123,6 +123,7 @@ How a site that moves is written with PostHog's SDK for its language. Step 7 say - `from`, `subject`, `html`, `text`, and the reply-to address keep their values, under the PostHog SDK's names. - A send with rendered content gets a template key, as Step 7 says. - The idempotency key moves into the send, under the PostHog SDK's name for it. +- Resend sets open and click tracking per domain, not per send, so the call doesn't show it. Step 3 reads the domain's open and click tracking from the person in one question, as `account.md` says under "Open tracking" and "Click tracking". A site whose plan note says `opens off` turns off the `opens` switch of tracking, as Step 7 says. Step 7 marks every code send sensitive and never turns `clicks` on, so when the domain tracks clicks in Resend, note in the plan and the report that PostHog doesn't count these emails' clicks. **Templates brought into the code.** The site renders the email from its `variables`, as "Templates" says, and sends the template key, the rendered subject, HTML, and text, and the `from` and reply-to address: the site's own where it sets them, otherwise the template's. It sends no template ID and no template data. diff --git a/context/skills/migrate-email/references/rewrite-dotnet.md b/context/skills/migrate-email/references/rewrite-dotnet.md index 2aad21e9..e7c798eb 100644 --- a/context/skills/migrate-email/references/rewrite-dotnet.md +++ b/context/skills/migrate-email/references/rewrite-dotnet.md @@ -37,7 +37,7 @@ With `SecretKey` set, the client loads flag definitions from its host with it wh ## The send -- Code send: `await emails.SendAsync(new SendCodeEmailOptions { To, TemplateKey, Subject, Html, Text, DistinctId, IdempotencyKey })`, with `From`, `ReplyTo`, `CaptureEngagement`, and `Sensitive = true` optional. +- Code send: `await emails.SendAsync(new SendCodeEmailOptions { To, TemplateKey, Subject, Html, Text, DistinctId, IdempotencyKey })`, with `From`, `ReplyTo`, `Sensitive`, and `Tracking` optional. `Tracking` takes `EmailTracking.All`, `EmailTracking.None`, or `new EmailTracking { Opens, Clicks, Engagement }`. Open tracking off is `Tracking = new EmailTracking { Opens = false }`. `CaptureEngagement` is deprecated: use `Tracking = new EmailTracking { Engagement = false }`. Sensitive is `Sensitive = true`. - Template send: `await emails.SendAsync(new SendTemplateEmailOptions { To, TemplateId, TemplateData, DistinctId, IdempotencyKey })`. - `ReplyTo` is a list, and `TemplateId` is a `Guid`. - There is no synchronous send. A site in a method that is not `async` and doesn't return the send's `Task` stays, with the reason `synchronous .NET send`, unless the person agrees to make the method and its callers `async`. Never block on `SendAsync` with `.Result` or `.Wait()`. diff --git a/context/skills/migrate-email/references/rewrite-elixir.md b/context/skills/migrate-email/references/rewrite-elixir.md index c4686ee6..0e5aa8cb 100644 --- a/context/skills/migrate-email/references/rewrite-elixir.md +++ b/context/skills/migrate-email/references/rewrite-elixir.md @@ -34,7 +34,7 @@ Give email a named instance of its own in the application's children, also when ## The send -- Code send: `PostHog.Emails.send(MyApp.PostHogEmail, to: ..., template_key: ..., subject: ..., html: ..., text: ..., distinct_id: ..., idempotency_key: ...)`, with `from:`, `reply_to:`, `capture_engagement:`, and `sensitive: true` optional. +- Code send: `PostHog.Emails.send(MyApp.PostHogEmail, to: ..., template_key: ..., subject: ..., html: ..., text: ..., distinct_id: ..., idempotency_key: ...)`, with `from:`, `reply_to:`, `sensitive:`, and `tracking:` optional. `tracking:` takes `true`, `false`, or a map with `:opens`, `:clicks`, and `:engagement`. Open tracking off is `tracking: %{opens: false}`. `capture_engagement:` is deprecated: use `tracking: %{engagement: false}`. Sensitive is `sensitive: true`. - `reply_to:` takes one address or a list of addresses. - Template send: `PostHog.Emails.send(MyApp.PostHogEmail, to: ..., template_id: ..., template_data: %{...}, distinct_id: ..., idempotency_key: ...)`. diff --git a/context/skills/migrate-email/references/rewrite-go.md b/context/skills/migrate-email/references/rewrite-go.md index 68f89f5c..3ac13037 100644 --- a/context/skills/migrate-email/references/rewrite-go.md +++ b/context/skills/migrate-email/references/rewrite-go.md @@ -27,7 +27,7 @@ client, err := posthog.NewWithConfig(os.Getenv("POSTHOG_PROJECT_TOKEN"), posthog ## The send -- Code send: `client.Emails().Send(ctx, posthog.CodeEmail{To, TemplateKey, Subject, HTML, Text, DistinctID, IdempotencyKey})`, with `From`, `ReplyTo`, `CaptureEngagement` (`posthog.Ptr(false)`), and `Sensitive` (`posthog.Ptr(true)`) optional. +- Code send: `client.Emails().Send(ctx, posthog.CodeEmail{To, TemplateKey, Subject, HTML, Text, DistinctID, IdempotencyKey})`, with `From`, `ReplyTo`, `Sensitive`, and `Tracking` optional. `Tracking` takes `posthog.EmailTrackingOn()`, `posthog.EmailTrackingOff()`, or `posthog.EmailTrackingWith(posthog.EmailTrackingOptions{Opens, Clicks, Engagement})` with `posthog.Ptr` values. Open tracking off is `Tracking: posthog.EmailTrackingWith(posthog.EmailTrackingOptions{Opens: posthog.Ptr(false)})`. `CaptureEngagement` is deprecated: use `Tracking: posthog.EmailTrackingWith(posthog.EmailTrackingOptions{Engagement: posthog.Ptr(false)})`. Sensitive is `Sensitive: posthog.Ptr(true)`. - Template send: `client.Emails().Send(ctx, posthog.TemplateEmail{To, TemplateID, TemplateData, DistinctID, IdempotencyKey})`. - `ReplyTo` is a `[]string`, a list of addresses: wrap one address as `[]string{addr}`. - A site with no `context.Context` passes `context.Background()`. diff --git a/context/skills/migrate-email/references/rewrite-node.md b/context/skills/migrate-email/references/rewrite-node.md index a5498103..89e7c09c 100644 --- a/context/skills/migrate-email/references/rewrite-node.md +++ b/context/skills/migrate-email/references/rewrite-node.md @@ -30,7 +30,7 @@ export const posthog = new PostHog(process.env.POSTHOG_PROJECT_TOKEN, { ## The send -- Code send: `posthog.emails.send({ templateKey, to, subject, html, text, distinctId, idempotencyKey })`, with `from`, `replyTo`, `captureEngagement`, and `sensitive: true` optional. +- Code send: `posthog.emails.send({ templateKey, to, subject, html, text, distinctId, idempotencyKey })`, with `from`, `replyTo`, `sensitive`, and `tracking` optional. `tracking` takes `true`, `false`, or `{ opens, clicks, engagement }`. Open tracking off is `tracking: { opens: false }`. `captureEngagement` is deprecated: use `tracking: { engagement: false }`. Sensitive is `sensitive: true`. - `replyTo` takes one address or a list of addresses. - Template send: `posthog.emails.send({ to, templateId, templateData, distinctId, idempotencyKey })`. - A component the provider rendered, such as React Email, is rendered in the app with `render` from `@react-email/render`, and sent as `html`. diff --git a/context/skills/migrate-email/references/rewrite-php.md b/context/skills/migrate-email/references/rewrite-php.md index 42750f87..b83a37fa 100644 --- a/context/skills/migrate-email/references/rewrite-php.md +++ b/context/skills/migrate-email/references/rewrite-php.md @@ -36,7 +36,7 @@ $posthog = new Client( ## The send -- Code send: `$posthog->emails()->send(['to' => ..., 'template_key' => ..., 'subject' => ..., 'html' => ..., 'text' => ..., 'distinct_id' => ..., 'idempotency_key' => ...])`, with `'from'`, `'reply_to'`, `'capture_engagement'`, and `'sensitive' => true` optional. +- Code send: `$posthog->emails()->send(['to' => ..., 'template_key' => ..., 'subject' => ..., 'html' => ..., 'text' => ..., 'distinct_id' => ..., 'idempotency_key' => ...])`, with `'from'`, `'reply_to'`, `'sensitive'`, and `'tracking'` optional. `'tracking'` takes `true`, `false`, or an array with `'opens'`, `'clicks'`, and `'engagement'`. Open tracking off is `'tracking' => ['opens' => false]`. `'capture_engagement'` is deprecated: use `'tracking' => ['engagement' => false]`. Sensitive is `'sensitive' => true`. - `'reply_to'` takes one address or a list of addresses. - Template send: `$posthog->emails()->send(['to' => ..., 'template_id' => ..., 'template_data' => [...], 'distinct_id' => ..., 'idempotency_key' => ...])`. diff --git a/context/skills/migrate-email/references/rewrite-python.md b/context/skills/migrate-email/references/rewrite-python.md index ac2e66aa..73917fd9 100644 --- a/context/skills/migrate-email/references/rewrite-python.md +++ b/context/skills/migrate-email/references/rewrite-python.md @@ -34,7 +34,7 @@ posthog = Posthog( ## The send -- Code send: `posthog.emails.send(template_key=..., to=..., subject=..., html=..., text=..., distinct_id=..., idempotency_key=...)`, with `from_`, `reply_to`, `capture_engagement`, and `sensitive=True` optional. `from` is a Python keyword, so the argument is `from_`. +- Code send: `posthog.emails.send(template_key=..., to=..., subject=..., html=..., text=..., distinct_id=..., idempotency_key=...)`, with `from_`, `reply_to`, `sensitive`, and `tracking` optional. `tracking` takes `True`, `False`, or a dict with `"opens"`, `"clicks"`, and `"engagement"`. Open tracking off is `tracking={"opens": False}`. `capture_engagement` is deprecated: use `tracking={"engagement": False}`. `from` is a Python keyword, so the argument is `from_`. Sensitive is `sensitive=True`. - `reply_to` takes one address or a list of addresses. - Template send: `posthog.emails.send(to=..., template_id=..., template_data=..., distinct_id=..., idempotency_key=...)`. diff --git a/context/skills/migrate-email/references/rewrite-ruby.md b/context/skills/migrate-email/references/rewrite-ruby.md index 3290403d..6f450fb4 100644 --- a/context/skills/migrate-email/references/rewrite-ruby.md +++ b/context/skills/migrate-email/references/rewrite-ruby.md @@ -29,7 +29,7 @@ POSTHOG = PostHog::Client.new({ ## The send -- Code send: `POSTHOG.emails.send(to:, template_key:, subject:, html:, text:, distinct_id:, idempotency_key:)`, with `from:`, `reply_to:`, `capture_engagement:`, and `sensitive: true` optional. +- Code send: `POSTHOG.emails.send(to:, template_key:, subject:, html:, text:, distinct_id:, idempotency_key:)`, with `from:`, `reply_to:`, `sensitive:`, and `tracking:` optional. `tracking:` takes `true`, `false`, or a hash with `opens`, `clicks`, and `engagement`. Open tracking off is `tracking: { opens: false }`. `capture_engagement:` is deprecated: use `tracking: { engagement: false }`. Sensitive is `sensitive: true`. - `reply_to:` takes one address or a list of addresses. - Template send: `POSTHOG.emails.send(to:, template_id:, template_data:, distinct_id:, idempotency_key:)`. diff --git a/context/skills/migrate-email/references/rewrite-rust.md b/context/skills/migrate-email/references/rewrite-rust.md index e426bf40..5c22dc71 100644 --- a/context/skills/migrate-email/references/rewrite-rust.md +++ b/context/skills/migrate-email/references/rewrite-rust.md @@ -31,7 +31,7 @@ let posthog = posthog_rs::client(options.build()?).await; // with `async-client` ## The send -- Code send: `posthog.emails().send(CodeEmail::new(to, template_key, subject).html(...).text(...).distinct_id(...).idempotency_key(...))`, with `.from(...)`, `.reply_to(...)`, `.capture_engagement(false)`, and `.sensitive(true)` optional. +- Code send: `posthog.emails().send(CodeEmail::new(to, template_key, subject).html(...).text(...).distinct_id(...).idempotency_key(...))`, with `.from(...)`, `.reply_to(...)`, `.sensitive(...)`, and `.tracking(...)` optional. `.tracking(...)` takes `EmailTracking::On`, `EmailTracking::Off`, or `EmailTrackingOptions::new()` with `.opens(...)`, `.clicks(...)`, and `.engagement(...)`. Open tracking off is `.tracking(EmailTrackingOptions::new().opens(false))`. `.capture_engagement(false)` is deprecated: use `.tracking(EmailTrackingOptions::new().engagement(false))`. Sensitive is `.sensitive(true)`. - Template send: `posthog.emails().send(TemplateEmail::new(to, template_id).template_data(...).distinct_id(...).idempotency_key(...))`. - With the async client, await the send. - Call `.reply_to(...)` once per address. diff --git a/context/skills/migrate-email/references/sendgrid/account.md b/context/skills/migrate-email/references/sendgrid/account.md index 945c9e13..d61647cd 100644 --- a/context/skills/migrate-email/references/sendgrid/account.md +++ b/context/skills/migrate-email/references/sendgrid/account.md @@ -28,9 +28,9 @@ The steps call this key the full-access provider key. ## Tracking -A send follows the account's open and click tracking for each of the two that its `trackingSettings` doesn't set. What PostHog does with opens and clicks is in `mapping.md` under "Open and click tracking". Ask the person once whether open tracking and click tracking are on in SendGrid (Settings, then Tracking), and whether click tracking also covers plain-text emails, and note the answers in the plan. +A send follows the account's open and click tracking for each of the two that its `trackingSettings` doesn't set. What PostHog does with opens and clicks is in `mapping.md` under "Open and click tracking". Ask the person once whether open tracking and click tracking are on in SendGrid (Settings, then Tracking), and whether click tracking also covers plain-text emails, and note the answers in the plan. This asks about SendGrid's settings, never whether PostHog may add its pixel. -A site's emails had no open pixel when its `trackingSettings` sets `openTracking` with `enable: false`, or sets no `openTracking` while the account's open tracking is off. When it sets none and the person can't say whether open tracking is on, nobody can tell whether they had one. Step 3 says under "Opens the provider didn't track" what either means. +A site's emails had no open pixel when its `trackingSettings` sets `openTracking` with `enable: false`, or sets no `openTracking` while the account's open tracking is off. When it sets none and the person can't say whether open tracking is on, nobody can tell whether they had one. Either way the site moves with opens off, as Step 3 says under "Opens the provider didn't track". SendGrid didn't track a site's clicks when its `trackingSettings` sets `clickTracking` with `enable: false`, or sets no `clickTracking` while the account's click tracking is off. It didn't track the links in a plain-text part either, unless `clickTracking` sets `enableText: true`, or sets no `clickTracking` while the account's click tracking covers plain-text emails: a site whose plain-text part has a link SendGrid didn't track counts as one whose clicks SendGrid didn't track. When it sets no `clickTracking` and the person can't say whether click tracking is on, or whether it covers plain text for a site whose plain-text part has a link, nobody knows whether SendGrid tracked them. Step 3 says under "A template in PostHog" what either means for a site that moves to a template made in PostHog. diff --git a/context/skills/migrate-email/references/sendgrid/mapping.md b/context/skills/migrate-email/references/sendgrid/mapping.md index 59397470..df0e7cbb 100644 --- a/context/skills/migrate-email/references/sendgrid/mapping.md +++ b/context/skills/migrate-email/references/sendgrid/mapping.md @@ -21,7 +21,7 @@ PostHog fields are written in their Node.js names here, such as `replyTo`. Use t | `customArgs` | none | Always: no PostHog SDK takes tags yet | | `categories` | none | Always: no PostHog SDK takes tags yet | | No `trackingSettings` | none, as "Open and click tracking" says | Opens and clicks follow the account, as "Open and click tracking" below and `account.md` under "Tracking" say | -| `trackingSettings` with `openTracking` or `clickTracking` | none, as "Open and click tracking" says | Opens and clicks follow "Open and click tracking" below. It stays when the settings do anything else, such as `subscriptionTracking`, `ganalytics`, or an `openTracking` `substitutionTag`: PostHog places its own pixel, so the tag would stay in the email as text | +| `trackingSettings` with `openTracking` or `clickTracking` | none, as "Open and click tracking" says | Opens and clicks follow "Open and click tracking" below. It stays when the settings do anything else, such as `subscriptionTracking`, `ganalytics`, or an `openTracking` `substitutionTag`: PostHog never fills the tag, so it would stay in the email as text | | `sendAt` / `send_at` | none | Always. PostHog's send doesn't take it yet | | `batchId` / `batch_id` | none | Always. PostHog's send doesn't take it yet | | `asm` | none | Always: PostHog has no unsubscribe groups on a transactional send | @@ -29,10 +29,10 @@ PostHog fields are written in their Node.js names here, such as `replyTo`. Use t | `mailSettings` / `mail_settings` | none | Always. Sandbox mode is not a send | | `personalizations` | the fields of its one entry | It holds more than one entry. One entry moves when each field in it moves | -**Open and click tracking.** PostHog adds its open pixel to every email it sends, and a send in the code form counts no clicks, as Step 7 says. No field changes this: `captureEngagement` decides only whether the email's events land on the recipient's person, so tracking never maps to it. SendGrid decides opens and clicks one at a time. When the send's `trackingSettings` sets `openTracking` or `clickTracking`, that setting's `enable` decides for it. Otherwise the account's setting decides, as `account.md` says under "Tracking". +**Open and click tracking.** No SendGrid field maps directly in the call to PostHog's tracking: Step 7 sets `tracking` from the plan, as it says under "Sensitive emails and tracking", and never writes the deprecated `captureEngagement` field. SendGrid decides opens and clicks one at a time. When the send's `trackingSettings` sets `openTracking` or `clickTracking`, that setting's `enable` decides for it. When `openTracking`'s `enable` changes from send to send, the site stays, as Step 3 says under "Opens the provider didn't track". Otherwise the account's setting decides, as `account.md` says under "Tracking". -- Opens: `account.md` says under "Tracking" which sites' emails had no open pixel, and for which nobody can tell. Those sites follow Step 3 under "Opens the provider didn't track". -- Clicks: when SendGrid tracked a moved site's clicks, or nobody knows whether it did, note in the plan row that PostHog counts no clicks for it, unless it moves to a template made in PostHog that is not marked sensitive. When SendGrid didn't track them, or nobody knows, as `account.md` says under "Tracking", a site that moves to a template made in PostHog follows Step 3 under "A template in PostHog". +- Opens: `account.md` says under "Tracking" which sites' emails had no open pixel, and for which nobody can tell. Those sites move with opens off, as Step 3 says under "Opens the provider didn't track". Never ask the person whether PostHog may add its pixel. +- Clicks: Step 7 marks every code send sensitive and never turns `clicks` on, so PostHog counts no clicks for a code send. When SendGrid tracked a moved site's clicks, or nobody knows whether it did, note in the plan row that PostHog counts no clicks for it, unless it moves to a template made in PostHog that is not marked sensitive. When SendGrid didn't track them, or nobody knows, as `account.md` says under "Tracking", a site that moves to a template made in PostHog follows Step 3 under "A template in PostHog". **Account mail settings.** SendGrid's subscription tracking, Google Analytics, Legacy Email Template, and Footer settings change a send that sets no field for them. `account.md` says under "Mail settings" which sites they keep on SendGrid, and how a moved site keeps the footer. @@ -125,13 +125,13 @@ The Event Webhook stops getting events for a site that moves. PostHog records th | `bounce` | `$workflows_email_bounced` | | `spamreport` | `$workflows_email_blocked` | | `open` | `$workflows_email_opened` | -| `click` | `$workflows_email_link_clicked`, only for a template made in PostHog that is not marked sensitive. A send in the code form counts no clicks | +| `click` | `$workflows_email_link_clicked`, only when PostHog tracks the email's clicks: for a template made in PostHog that is not marked sensitive and with tracking on, or a code send whose tracking leaves clicks on, as the table in Step 7 under "Sensitive emails and tracking" says. Step 7 marks every code send sensitive and never turns `clicks` on, so its links go out as they are, and PostHog counts no clicks | | `dropped` | none. PostHog refuses the send instead, such as with `recipient_suppressed` | | `deferred`, `unsubscribe`, `group_unsubscribe`, `group_resubscribe` | none | PostHog's events carry no SendGrid `sg_message_id` and no `custom_args`. A site whose events a handler matches by message id or by a custom arg stays on SendGrid. For every other handler, the report tells the person which events it handles, which PostHog events take their place, and that a webhook destination in PostHog (Data pipelines, then Destinations) can post them to an endpoint. The handler itself keeps working for the sites that stay. Never change it. -A site whose emails a handler acts on for an event that has no PostHog event in the table, such as `dropped` or `deferred`, stays, and the reason is `its events feed a webhook handler`. SendGrid sends `unsubscribe`, `group_unsubscribe`, and `group_resubscribe` only for emails with subscription tracking or `asm`, which keep their sites on SendGrid already, so a handler on those events keeps no other site. A site whose emails a `click` handler acts on moves only to a template made in PostHog that is not marked sensitive. Otherwise it stays, and the reason is `its clicks feed a webhook handler`. +A site whose emails a handler acts on for an event that has no PostHog event in the table, such as `dropped` or `deferred`, stays, and the reason is `its events feed a webhook handler`. SendGrid sends `unsubscribe`, `group_unsubscribe`, and `group_resubscribe` only for emails with subscription tracking or `asm`, which keep their sites on SendGrid already, so a handler on those events keeps no other site. A site whose emails a `click` handler acts on stays, and the reason is `its clicks feed a webhook handler`, as Step 3 says under "Opens the provider didn't track". ## Rewrite