Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

update PartnerInvite email

Steven Teye8c125969f04
diff --git a/apps/web/lib/actions/partners/create-program.ts b/apps/web/lib/actions/partners/create-program.ts
index 2e94d208c9..c4c924d90a 100644
--- a/apps/web/lib/actions/partners/create-program.ts
+++ b/apps/web/lib/actions/partners/create-program.ts
@@ -237,6 +237,7 @@ async function invitePartner({
email: partner.email,
program: {
name: program.name,
+ slug: program.slug,
logo: program.logo,
},
}),
diff --git a/apps/web/lib/actions/partners/invite-partner.ts b/apps/web/lib/actions/partners/invite-partner.ts
index f800b4d9e2..d3f37d3f30 100644
--- a/apps/web/lib/actions/partners/invite-partner.ts
+++ b/apps/web/lib/actions/partners/invite-partner.ts
@@ -114,6 +114,7 @@ export const invitePartnerAction = authActionClient
email,
program: {
name: program.name,
+ slug: program.slug,
logo: program.logo,
},
}),
diff --git a/apps/web/lib/actions/partners/resend-program-invite.ts b/apps/web/lib/actions/partners/resend-program-invite.ts
index 72d60b3b04..c5ab913172 100644
--- a/apps/web/lib/actions/partners/resend-program-invite.ts
+++ b/apps/web/lib/actions/partners/resend-program-invite.ts
@@ -56,6 +56,7 @@ export const resendProgramInviteAction = authActionClient
email: partner.email!,
program: {
name: program.name,
+ slug: program.slug,
logo: program.logo,
},
}),
diff --git a/packages/email/src/templates/partner-invite.tsx b/packages/email/src/templates/partner-invite.tsx
index 241a3c1727..5777215323 100644
--- a/packages/email/src/templates/partner-invite.tsx
+++ b/packages/email/src/templates/partner-invite.tsx
@@ -18,12 +18,14 @@ export function PartnerInvite({
email = "[email protected]",
program = {
name: "Acme",
+ slug: "acme",
logo: DUB_WORDMARK,
},
}: {
email: string;
program: {
name: string;
+ slug: string;
logo: string | null;
};
}) {
@@ -62,7 +64,7 @@ export function PartnerInvite({
<Section className="mb-12 mt-8">
<Link
className="rounded-lg bg-neutral-900 px-4 py-3 text-[12px] font-semibold text-white no-underline"
- href="https://partners.dub.co/register"
+ href={`https://partners.dub.co/${program.slug}/register`}
>
Accept Invite
</Link>
diff --git a/packages/tinybird/pipes/v2_utms.pipe b/packages/tinybird/pipes/v2_utms.pipe
index 707904fa2b..58907e28c4 100644
--- a/packages/tinybird/pipes/v2_utms.pipe
+++ b/packages/tinybird/pipes/v2_utms.pipe
@@ -31,16 +31,18 @@ SQL >
%
WITH
- extractURLParameter(
- decodeURLFormComponent(url),
- {{
- String(
- groupByUtmTag,
- 'utm_source',
- description="The UTM tag to retrieve data for",
- required=True,
- )
- }}
+ decodeURLFormComponent(
+ extractURLParameter(
+ url,
+ {{
+ String(
+ groupByUtmTag,
+ 'utm_source',
+ description="The UTM tag to retrieve data for",
+ required=True,
+ )
+ }}
+ )
) as utm
SELECT utm, count(*) as clicks
FROM
@@ -71,20 +73,23 @@ SQL >
{% if defined(referer) %} AND referer = {{ referer }} {% end %}
{% if defined(refererUrl) %} AND splitByString('?', referer_url)[1] = {{ refererUrl }} {% end %}
{% if defined(utm_source) %}
- AND url LIKE concat('%utm_source=', encodeURLFormComponent({{ String(utm_source) }}), '%')
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_source'))
+ = {{ String(utm_source) }}
{% end %}
{% if defined(utm_medium) %}
- AND url LIKE concat('%utm_medium=', encodeURLFormComponent({{ String(utm_medium) }}), '%')
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_medium'))
+ = {{ String(utm_medium) }}
{% end %}
{% if defined(utm_campaign) %}
- AND url
- LIKE concat('%utm_campaign=', encodeURLFormComponent({{ String(utm_campaign) }}), '%')
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_campaign'))
+ = {{ String(utm_campaign) }}
{% end %}
{% if defined(utm_term) %}
- AND url LIKE concat('%utm_term=', encodeURLFormComponent({{ String(utm_term) }}), '%')
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_term')) = {{ String(utm_term) }}
{% end %}
{% if defined(utm_content) %}
- AND url LIKE concat('%utm_content=', encodeURLFormComponent({{ String(utm_content) }}), '%')
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_content'))
+ = {{ String(utm_content) }}
{% end %}
{% if defined(url) %} AND url = {{ url }} {% end %}
{% if defined(start) %} AND timestamp >= {{ DateTime64(start) }} {% end %}
@@ -100,16 +105,18 @@ SQL >
%
WITH
- extractURLParameter(
- decodeURLFormComponent(url),
- {{
- String(
- groupByUtmTag,
- 'utm_source',
- description="The UTM tag to retrieve data for",
- required=True,
- )
- }}
+ decodeURLFormComponent(
+ extractURLParameter(
+ url,
+ {{
+ String(
+ groupByUtmTag,
+ 'utm_source',
+ description="The UTM tag to retrieve data for",
+ required=True,
+ )
+ }}
+ )
) as utm
SELECT utm, count(*) as leads
FROM
@@ -131,11 +138,25 @@ SQL >
{% if defined(os) %} AND os = {{ os }} {% end %}
{% if defined(referer) %} AND referer = {{ referer }} {% end %}
{% if defined(refererUrl) %} AND splitByString('?', referer_url)[1] = {{ refererUrl }} {% end %}
- {% if defined(utm_source) %} AND url LIKE concat('%utm_source=', encodeURLFormComponent({{ String(utm_source) }}), '%') {% end %}
- {% if defined(utm_medium) %} AND url LIKE concat('%utm_medium=', encodeURLFormComponent({{ String(utm_medium) }}), '%') {% end %}
- {% if defined(utm_campaign) %} AND url LIKE concat('%utm_campaign=', encodeURLFormComponent({{ String(utm_campaign) }}), '%') {% end %}
- {% if defined(utm_term) %} AND url LIKE concat('%utm_term=', encodeURLFormComponent({{ String(utm_term) }}), '%') {% end %}
- {% if defined(utm_content) %} AND url LIKE concat('%utm_content=', encodeURLFormComponent({{ String(utm_content) }}), '%') {% end %}
+ {% if defined(utm_source) %}
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_source'))
+ = {{ String(utm_source) }}
+ {% end %}
+ {% if defined(utm_medium) %}
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_medium'))
+ = {{ String(utm_medium) }}
+ {% end %}
+ {% if defined(utm_campaign) %}
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_campaign'))
+ = {{ String(utm_campaign) }}
+ {% end %}
+ {% if defined(utm_term) %}
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_term')) = {{ String(utm_term) }}
+ {% end %}
+ {% if defined(utm_content) %}
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_content'))
+ = {{ String(utm_content) }}
+ {% end %}
{% if defined(url) %} AND url = {{ url }} {% end %}
{% if defined(start) %} AND timestamp >= {{ DateTime64(start) }} {% end %}
{% if defined(end) %} AND timestamp <= {{ DateTime64(end) }} {% end %}
@@ -150,23 +171,25 @@ SQL >
%
WITH
- extractURLParameter(
- decodeURLFormComponent(url),
- {{
- String(
- groupByUtmTag,
- 'utm_source',
- description="The UTM tag to retrieve data for",
- required=True,
- )
- }}
+ decodeURLFormComponent(
+ extractURLParameter(
+ url,
+ {{
+ String(
+ groupByUtmTag,
+ 'utm_source',
+ description="The UTM tag to retrieve data for",
+ required=True,
+ )
+ }}
+ )
) as utm
SELECT utm, count(*) as sales, sum(amount) as saleAmount
FROM
dub_sale_events_mv
- {% if not defined(linkId) and (defined(workspaceId) or defined(partnerId) or defined(programId)) %}
- PREWHERE link_id in (SELECT link_id from workspace_links)
- {% end %}
+ {% if not defined(linkId) and (
+ defined(workspaceId) or defined(partnerId) or defined(programId)
+ ) %} PREWHERE link_id in (SELECT link_id from workspace_links) {% end %}
WHERE
url != ''
{% if defined(linkId) %} AND link_id = {{ String(linkId) }} {% end %}
@@ -181,11 +204,25 @@ SQL >
{% if defined(os) %} AND os = {{ os }} {% end %}
{% if defined(referer) %} AND referer = {{ referer }} {% end %}
{% if defined(refererUrl) %} AND splitByString('?', referer_url)[1] = {{ refererUrl }} {% end %}
- {% if defined(utm_source) %} AND url LIKE concat('%utm_source=', encodeURLFormComponent({{ String(utm_source) }}), '%') {% end %}
- {% if defined(utm_medium) %} AND url LIKE concat('%utm_medium=', encodeURLFormComponent({{ String(utm_medium) }}), '%') {% end %}
- {% if defined(utm_campaign) %} AND url LIKE concat('%utm_campaign=', encodeURLFormComponent({{ String(utm_campaign) }}), '%') {% end %}
- {% if defined(utm_term) %} AND url LIKE concat('%utm_term=', encodeURLFormComponent({{ String(utm_term) }}), '%') {% end %}
- {% if defined(utm_content) %} AND url LIKE concat('%utm_content=', encodeURLFormComponent({{ String(utm_content) }}), '%') {% end %}
+ {% if defined(utm_source) %}
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_source'))
+ = {{ String(utm_source) }}
+ {% end %}
+ {% if defined(utm_medium) %}
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_medium'))
+ = {{ String(utm_medium) }}
+ {% end %}
+ {% if defined(utm_campaign) %}
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_campaign'))
+ = {{ String(utm_campaign) }}
+ {% end %}
+ {% if defined(utm_term) %}
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_term')) = {{ String(utm_term) }}
+ {% end %}
+ {% if defined(utm_content) %}
+ AND decodeURLFormComponent(extractURLParameter(url, 'utm_content'))
+ = {{ String(utm_content) }}
+ {% end %}
{% if defined(url) %} AND url = {{ url }} {% end %}
{% if defined(start) %} AND timestamp >= {{ DateTime64(start) }} {% end %}
{% if defined(end) %} AND timestamp <= {{ DateTime64(end) }} {% end %}