SendGrid
With SendGrid, Tolinku handles your click-tracking domain. You point SendGrid’s link branding subdomain at Tolinku, and Tolinku passes everything through to SendGrid. Links you mark with universal="true" open your app; every other link, including unsubscribe, stays in the browser. SendGrid keeps counting clicks.
For how this works and what it needs, see Email Links.
Before you start
Section titled “Before you start”- A paid Tolinku plan. Email links aren’t on the Free plan.
- Your Apple team ID and bundle ID and/or your Android package name and SHA-256 fingerprint in Settings (Configuring iOS, Configuring Android).
- App open attribution not set to Always (Attributing App Opens).
- The Admin or Owner role in the Appspace.
- Link branding set up in SendGrid, under Settings > Sender Authentication, Link Branding. Your link branding domain is your click-tracking domain, for example
email.links.yourapp.com. If you haven’t set it up yet, follow SendGrid’s guide: How to set up link branding. - Access to the DNS records for that domain.
Add the domain in Tolinku
Section titled “Add the domain in Tolinku”-
Go to Domains in the sidebar.
-
In the Email links card, click Add email domain.
-
Under Tolinku handles the domain, choose SendGrid.
-
In Click-tracking domain, enter your SendGrid link branding domain, for example
email.links.yourapp.com. -
Click Add email domain. The setup steps open.
Prove you own the domain
Section titled “Prove you own the domain”Tolinku only answers on the domain once you’ve proved it’s yours, so nobody else can claim it.
-
Under Prove you own the domain, copy the TXT record. Its name is
_tolinku.followed by your domain, and its value starts withtolinku-verify=.Type Name Value TXT _tolinku.email.links.yourapp.comtolinku-verify=... -
Add the record at your DNS provider. Leave the CNAME pointing at SendGrid for now.
-
Click Check the record. When it’s found, the step shows Verified. You can leave the TXT record in place.
If it says the record isn’t there yet, wait a few minutes and try again. DNS changes take time to spread.
Point the domain at Tolinku
Section titled “Point the domain at Tolinku”Do this only after the domain is verified.
-
At your DNS provider, find the CNAME record for your link branding domain. It points to
sendgrid.net. -
Change its value to
edge.tolinku.com.Type Name Value CNAME email.links(your subdomain)edge.tolinku.com -
Back in Tolinku, the step shows Done once the change is seen, and SSL once the certificate is issued. The certificate is issued for you.
SendGrid’s link branding uses more than one DNS record (and more again if SendGrid issues its SSL certificate). Change only the CNAME for your link branding domain itself, and leave the others as they are.
Tolinku passes every request on to SendGrid, so its click and open tracking, unsubscribe links and reports keep working.
Mark the links that should open the app
Section titled “Mark the links that should open the app”Add universal="true" to each link in your emails that should open the app. SendGrid then puts /uni/ at the start of the link’s path, and only those links open the app. Unsubscribe and every other link stay in the browser.
<a href="https://links.yourapp.com/product/42" universal="true">See the product</a>Point the link at your normal Tolinku link, on your Tolinku domain. Once it’s tapped, Tolinku works out the route from it.
Marketing Campaigns doesn’t add the attribute for you, so edit the link in your template’s HTML. See SendGrid’s guide: Universal Links. You don’t need to host any files yourself, as that guide describes; Tolinku serves them on your domain.
Only mark links that lead into your app. Leave links to other websites unmarked.
Set up your app
Section titled “Set up your app”The setup steps in the dashboard end with Add the domain to your app, which shows these lines for your domain.
iOS: in Xcode, under Signing & Capabilities, add the domain to Associated Domains:
applinks:email.links.yourapp.comAndroid: add an intent filter for the domain. The path prefix makes only the links you marked open the app. Give it its own <intent-filter>, so it doesn’t change how your other link domains are matched.
<intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="email.links.yourapp.com" android:pathPrefix="/uni/" /></intent-filter>In your code: pass every link your app opens with to links.resolve. It needs Tolinku SDK 0.8.2 or later, configured with your publishable API key.
if let link = await Tolinku.shared?.links.resolve(url) { route(link.deepLinkPath)}val link = Tolinku.links.resolve(uri.toString())if (link != null) route(link.deepLinkPath)const link = await Tolinku.links.resolve(url);if (link) route(link.deep_link_path);final link = await Tolinku.instance.links.resolve(url);if (link != null) route(link.deepLinkPath);const link = await tolinku.links.resolve(url);if (link) route(link.deep_link_path);When resolve returns nothing, fall back to your own handling. See Set up your app for the full version.
Release the app update before you send emails that rely on it. People with an older version of your app will see links open the browser, as they did before.
Test it
Section titled “Test it”Send an email to a phone that has the new version of your app, and tap a link marked universal="true". The app should open on the right screen. A link without the attribute should open in the browser. Tapping a link pasted into Safari’s address bar never opens an app, so always test from an email.
The click shows up in SendGrid’s reports as before.
Removing the domain
Section titled “Removing the domain”-
At your DNS provider, point the CNAME back at
sendgrid.net. -
Wait for the change to take effect.
-
In Tolinku, open the domain from the Email links card and click Remove.
If you remove it in Tolinku first, links in emails you’ve already sent stop working.
For more questions, see the FAQ.