diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index d4aba19..5122806 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -9,5 +9,6 @@ jobs: uses: "SFDO-Community/standard-workflows/.github/workflows/beta-2gp.yml@main" secrets: dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" - with: - cumulusci-version: '3.86.1' + # with: + # cumulusci-version: '3.93.0' + # sfdx-version: '7.209.6' diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index fb33093..5bf1d9c 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -1,15 +1,11 @@ name: "Feature Test" on: - push: - branches: - - feature/** - + pull_request: + workflow_dispatch: jobs: - feature-test: - name: "Feature Test" - uses: "SFDO-Community/standard-workflows/.github/workflows/feature.yml@main" - secrets: - dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" - with: - cumulusci-version: '3.86.1' + feature-test: + name: "Feature Test" + uses: "SFDO-Community/standard-workflows/.github/workflows/feature.yml@main" + secrets: + dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" \ No newline at end of file diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index f367ae5..e704693 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -1,10 +1,11 @@ on: - workflow_dispatch: + workflow_dispatch: jobs: upload-production-release-2gp: name: "Upload Production Release (2GP)" uses: SFDO-Community/standard-workflows/.github/workflows/production-2gp.yml@main - with: - cumulusci-version: '3.86.1' + # with: + # cumulusci-version: '3.93.0' + # sfdx-version: '7.209.6' secrets: dev-hub-auth-url: '${{ secrets.PACKAGING_ORG_AUTH_URL }}' diff --git a/CODEOWNERS b/CODEOWNERS index ce7a494..f1550f4 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,2 +1,14 @@ -# Comment line immediately above ownership line is reserved for related other information. Please be careful while editing. +# Python +*.py @SFDO-Community/sfdo-release-engineers + +# CumulusCI +/cumulusci.yml @SFDO-Community/sfdo-release-engineers +/tasks/ @SFDO-Community/sfdo-release-engineers + +# Actions +/.github @SFDO-Community/sfdo-release-engineers +/scripts @SFDO-Community/sfdo-release-engineers + + #ECCN:Open Source +#GUSINFO:Open Source,Open Source Workflow diff --git a/cumulusci.yml b/cumulusci.yml index 11eb9c8..b4dee9c 100644 --- a/cumulusci.yml +++ b/cumulusci.yml @@ -1,4 +1,4 @@ -minimum_cumulusci_version: '3.86.1' +minimum_cumulusci_version: '3.93.0' project: name: Unsubscribe-Link package: diff --git a/force-app/main/default/classes/UUIDBatchJob.cls b/force-app/main/default/classes/UUIDBatchJob.cls index f208d4e..ee56f15 100644 --- a/force-app/main/default/classes/UUIDBatchJob.cls +++ b/force-app/main/default/classes/UUIDBatchJob.cls @@ -109,12 +109,12 @@ public with sharing class UUIDBatchJob implements Database.Batchable { } ); - Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); - mail.setToAddresses(new List{ job.CreatedBy.Email }); - mail.setSubject('UUID Batch Job Complete'); - mail.setPlainTextBody(emailBody); - try { + Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); + mail.setToAddresses(new List{ job.CreatedBy.Email }); + mail.setSubject('UUID Batch Job Complete'); + mail.setPlainTextBody(emailBody); + Messaging.sendEmail(new List{ mail }); } catch (Exception e) { System.debug( diff --git a/force-app/main/default/email/Unsubscribe_Link.emailFolder-meta.xml b/force-app/main/default/email/Unsubscribe_Link.emailFolder-meta.xml new file mode 100644 index 0000000..307b43b --- /dev/null +++ b/force-app/main/default/email/Unsubscribe_Link.emailFolder-meta.xml @@ -0,0 +1,6 @@ + + + Public + UnsubscribeLink + ReadOnly + diff --git a/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Contact_Template_HTML.email b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Contact_Template_HTML.email new file mode 100644 index 0000000..f86d2ca --- /dev/null +++ b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Contact_Template_HTML.email @@ -0,0 +1,17 @@ + + +

Dear Friend,

+ +

It's Thursday! You love to order a pizza on Thursdays! If you order before 5, I'll also throw in some free drinks!

+ +

Your friend,

+ +

Bob

+ + + +
+
\ No newline at end of file diff --git a/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Contact_Template_HTML.email-meta.xml b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Contact_Template_HTML.email-meta.xml new file mode 100644 index 0000000..30fb7aa --- /dev/null +++ b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Contact_Template_HTML.email-meta.xml @@ -0,0 +1,12 @@ + + + 64.0 + true + Sample template for contact that demonstrates how to use the unsubscribe link visualforce object. + UTF-8 + Unsubscribe Sample Contact Template + + Edit this subject + visualforce + Aloha + diff --git a/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_HTML.email b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_HTML.email new file mode 100644 index 0000000..fe5b9ac --- /dev/null +++ b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_HTML.email @@ -0,0 +1,17 @@ + + +

Dear Friend,

+ +

It's Thursday! You love to order a pizza on Thursdays! If you order before 5, I'll also throw in some free drinks!

+ +

Your friend,

+ +

Bob

+ + + +
+
\ No newline at end of file diff --git a/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_HTML.email-meta.xml b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_HTML.email-meta.xml new file mode 100644 index 0000000..3f23bc9 --- /dev/null +++ b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_HTML.email-meta.xml @@ -0,0 +1,12 @@ + + + 64.0 + true + Sample template for lead that demonstrates how to use the unsubscribe link visualforce object. + UTF-8 + Unsubscribe Sample Lead Template + + Edit this subject + visualforce + Aloha + diff --git a/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_Plain_Text.email b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_Plain_Text.email new file mode 100644 index 0000000..4b47148 --- /dev/null +++ b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_Plain_Text.email @@ -0,0 +1,17 @@ + + +Dear Friend, + +It's Thursday! You love to order a pizza on Thursdays! If you order before 5, I'll also throw in some free drinks! + +Your friend, + +Bob + +Copy and paste this in your browser to unsubscribe: +{!Recipient.Unsubscribe_Url_Plain_Text__c} + + \ No newline at end of file diff --git a/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_Plain_Text.email-meta.xml b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_Plain_Text.email-meta.xml new file mode 100644 index 0000000..9b44272 --- /dev/null +++ b/force-app/main/default/email/Unsubscribe_Link/Unsubscribe_Lead_Template_Plain_Text.email-meta.xml @@ -0,0 +1,12 @@ + + + 64.0 + true + Sample template for lead that demonstrates how to use the unsubscribe link field in a plain text Visualforce email + UTF-8 + Unsubscribe Sample Lead Template-Plain Text + + Edit this subject + visualforce + Aloha + diff --git a/force-app/main/default/email/unfiled$public/Sample_Contact_Template_HTML.email b/force-app/main/default/email/unfiled$public/Sample_Contact_Template_HTML.email new file mode 100644 index 0000000..3956710 --- /dev/null +++ b/force-app/main/default/email/unfiled$public/Sample_Contact_Template_HTML.email @@ -0,0 +1,17 @@ + + +

Dear Friend,

+ +

It's Thursday! You love to order a pizza on Thursdays! If you order before 5, I'll also throw in some free drinks!

+ +

Your friend,

+ +

Bob

+ + + +
+
\ No newline at end of file diff --git a/force-app/main/default/email/unfiled$public/Sample_Contact_Template_HTML.email-meta.xml b/force-app/main/default/email/unfiled$public/Sample_Contact_Template_HTML.email-meta.xml new file mode 100644 index 0000000..d66ee3a --- /dev/null +++ b/force-app/main/default/email/unfiled$public/Sample_Contact_Template_HTML.email-meta.xml @@ -0,0 +1,12 @@ + + + 64.0 + true + Sample template for contact that demonstrates how to use the unsubscribe link visualforce object. + UTF-8 + Sample Contact Template + + Edit this subject + visualforce + Aloha + diff --git a/force-app/main/default/email/unfiled$public/Sample_Lead_Template_HTML.email b/force-app/main/default/email/unfiled$public/Sample_Lead_Template_HTML.email new file mode 100644 index 0000000..fe5b9ac --- /dev/null +++ b/force-app/main/default/email/unfiled$public/Sample_Lead_Template_HTML.email @@ -0,0 +1,17 @@ + + +

Dear Friend,

+ +

It's Thursday! You love to order a pizza on Thursdays! If you order before 5, I'll also throw in some free drinks!

+ +

Your friend,

+ +

Bob

+ + + +
+
\ No newline at end of file diff --git a/force-app/main/default/email/unfiled$public/Sample_Lead_Template_HTML.email-meta.xml b/force-app/main/default/email/unfiled$public/Sample_Lead_Template_HTML.email-meta.xml new file mode 100644 index 0000000..aed24c3 --- /dev/null +++ b/force-app/main/default/email/unfiled$public/Sample_Lead_Template_HTML.email-meta.xml @@ -0,0 +1,12 @@ + + + 64.0 + true + Sample template for lead that demonstrates how to use the unsubscribe link visualforce object. + UTF-8 + Sample Lead Template + + Edit this subject + visualforce + Aloha + diff --git a/force-app/main/default/email/unfiled$public/Sample_Lead_Template_Plain_Text.email b/force-app/main/default/email/unfiled$public/Sample_Lead_Template_Plain_Text.email new file mode 100644 index 0000000..edb2140 --- /dev/null +++ b/force-app/main/default/email/unfiled$public/Sample_Lead_Template_Plain_Text.email @@ -0,0 +1,17 @@ + + +Dear Friend, + +It's Thursday! You love to order a pizza on Thursdays! If you order before 5, I'll also throw in some free drinks! + +Your friend, + +Bob + +Copy and paste this in your browser to unsubscribe: +{!Recipient.Unsubscribe_Url_Plain_Text__c} + + \ No newline at end of file diff --git a/force-app/main/default/email/unfiled$public/Sample_Lead_Template_Plain_Text.email-meta.xml b/force-app/main/default/email/unfiled$public/Sample_Lead_Template_Plain_Text.email-meta.xml new file mode 100644 index 0000000..baf382d --- /dev/null +++ b/force-app/main/default/email/unfiled$public/Sample_Lead_Template_Plain_Text.email-meta.xml @@ -0,0 +1,12 @@ + + + 64.0 + true + Sample template for lead that demonstrates how to use the unsubscribe link field in a plain text Visualforce email. + UTF-8 + Sample Lead Template-Plain Text + + Edit this subject + visualforce + Aloha + diff --git a/force-app/main/default/flows/Unsubscribe_Link_Quick.flow-meta.xml b/force-app/main/default/flows/Unsubscribe_Link_Quick.flow-meta.xml index a5c160c..2ff0be1 100644 --- a/force-app/main/default/flows/Unsubscribe_Link_Quick.flow-meta.xml +++ b/force-app/main/default/flows/Unsubscribe_Link_Quick.flow-meta.xml @@ -5,7 +5,7 @@ ConfirmationEmail 50 - 1430 + 1706 emailSimple emailSimple @@ -53,13 +53,78 @@ emailSimple + + Send error email to the email address held in the ErrorRecipient variable. In case this Error Email send fails, the end user is still returned the success screen. + Send_Error_Email + + 578 + 1706 + emailSimple + emailSimple + + screenConfirmationNoEmail + + + true + screenConfirmationNoEmail + + CurrentTransaction + + emailAddresses + + ErrorRecipient + + + + composeEmailContent + + True + + + + emailSubject + + Org-wide Email error + + + + emailBody + + errorEmailRichText + + + + sendRichBody + + true + + + emailSimple + 61.0 + + Passes the error email recipient email from the unsubscribe link setup to a text variable used by subflows. + Set_ErrorRecipient + + 1128 + 242 + + ErrorRecipient + Assign + + Get_Unsubscribe_Link_Setup.Error_Email_Recipient__c + + + + Contact_or_Lead + + Was the original email with an unsubscribe link sent to a contact or a lead record? The Unsubscribe Link contains the public id., starting with C or L if it is a lead or contact. We need to find whether it is a contact or lead so that the Unsubscribe Record can be properly linked to the record. Contact_or_Lead - 842 - 242 + 1128 + 350 true Blank_Values_Flow @@ -96,11 +161,33 @@ + + Is_Org_Wide_Email_Address_Valid + + 314 + 1598 + + Send_Error_Email + + No, Invalid + + Is_OrgWideEmailAddressValid_true + and + + Get_Org_Wide_Email_Address.Id + NotEqualTo + + + ConfirmationEmail + + + + Quick_UnsubscribeDecision - 314 - 698 + 710 + 758 Are_you_sure @@ -125,8 +212,8 @@ The custom metadata type stores the yes/no answer to whether or not you want an email sent to confirm that the person unsubscribed. Send_Confirmation_Email - 314 - 1322 + 710 + 1382 screenConfirmationNoEmail @@ -142,7 +229,7 @@ - ConfirmationEmail + Get_Org_Wide_Email_Address @@ -152,8 +239,8 @@ If not, check if the custom metadata type allows the user to type in their email address. Was_a_Record_Found - 842 - 590 + 1128 + 650 No record found, no type in Yes_Record_Found1st @@ -186,7 +273,7 @@ If not, check if the custom metadata type allows the user to type in their email - Customer facing flow of the Unsubscribe Link managed package from AppExchange. + Customer facing flow of the Unsubscribe Link managed package from AppExchange. Updated to set the value of the error email recipient flow. Previously, the value was blank. Default get the total number of records that had this email address and unsubscribed. @@ -233,16 +320,12 @@ If not, check if the custom metadata type allows the user to type in their email Create Unsubscribe record which stores details of this transaction. Create_Unsubscribe_Record - 314 - 998 + 710 + 1058 UnsubscribeId.Id Unsubscribe_Contacts - - true - Error_Alert_Email - Contact__c @@ -273,16 +356,12 @@ If not, check if the custom metadata type allows the user to type in their email Look for a contact record with ID passed into the flow. Assign the email address to an email variable and the ID to a text variable called FoundId that is passed to other flows. Get_Contact - 314 - 350 + 864 + 458 true Was_a_Record_Found - - true - Error_Alert_Email - and Public_Id__c @@ -312,16 +391,12 @@ If not, check if the custom metadata type allows the user to type in their email Look for a lead record with ID passed into the flow. Assign the email address to an email variable and the ID to a text variable called FoundId that is passed to other flows. Get_Lead - 842 - 350 + 1128 + 458 true Was_a_Record_Found - - true - Error_Alert_Email - or Public_Id__c @@ -340,19 +415,44 @@ If not, check if the custom metadata type allows the user to type in their email Id + + Get Organization-Wide Email Address that is stored in the Unsubscribe Link Setup Record to check if it still exists and/or it has been verified + Get_Org_Wide_Email_Address + + 314 + 1490 + false + + Is_Org_Wide_Email_Address_Valid + + and + + Address + EqualTo + + Get_Unsubscribe_Link_Setup.Org_Wide_Email_Address__c + + + + IsVerified + EqualTo + + true + + + true + OrgWideEmailAddress + true + Get_Unsubscribe_Link_Setup - 842 + 1128 134 false - Contact_or_Lead + Set_ErrorRecipient - - true - Error_Alert_Email - true Unsubscribe_Link_Setup__c true @@ -362,8 +462,8 @@ If not, check if the custom metadata type allows the user to type in their email confirmation screen for person to confirm they want to unsubscribe. Update "our organization" in the custom metadata type "Unsubscribe Link." Are_you_sure - 402 - 806 + 798 + 866 false true false @@ -383,7 +483,7 @@ If not, check if the custom metadata type allows the user to type in their email Error_Alert_Email 314 - 1538 + 1814 true true true @@ -399,7 +499,7 @@ If not, check if the custom metadata type allows the user to type in their email screenConfirmationEmail 50 - 1538 + 1814 true true true @@ -414,8 +514,8 @@ If not, check if the custom metadata type allows the user to type in their email screenConfirmationNoEmail - 578 - 1430 + 710 + 2222 true true true @@ -428,7 +528,7 @@ If not, check if the custom metadata type allows the user to type in their email false - 716 + 1002 0 Get_Unsubscribe_Link_Setup @@ -438,8 +538,8 @@ If not, check if the custom metadata type allows the user to type in their email Blank_Values_Flow - 1106 - 698 + 1282 + 758 true Quick_UnsubscribeDecision @@ -470,8 +570,8 @@ If not, check if the custom metadata type allows the user to type in their email Launch this additional flow to find all contacts who have this email address and mark them as email opt out. Unsubscribe_Contacts - 314 - 1106 + 710 + 1166 Unsubscribe_Leads @@ -503,8 +603,8 @@ If not, check if the custom metadata type allows the user to type in their email Part of the unmanaged packed Unsubscribe Link from Salesforce Labs and loops through all leads with a particular email address to mark them as email opt out. This flow is launched by the flow Unsubscribe Link. Unsubscribe_Leads - 314 - 1214 + 710 + 1274 Send_Confirmation_Email @@ -543,6 +643,11 @@ If not, check if the custom metadata type allows the user to type in their email false <p><span style="color: rgb(62, 62, 60); background-color: rgb(255, 255, 255);">Alert: there was an error in running the Flow Unsubscribe Link Quick. This is part of the Unsubscribe Link managed package from appExchange. </span></p><p><br></p><p><span style="color: rgb(62, 62, 60); background-color: rgb(255, 255, 255);">The error is most likely that the flow could not find the required Unsubscribe Link Setup record.</span></p><p><br></p><p><span style="color: rgb(62, 62, 60); background-color: rgb(255, 255, 255);">Here are the variables that were input from the link in the email. </span></p><ul><li><span style="color: rgb(62, 62, 60); background-color: rgb(255, 255, 255);">publicId (the id passed in the URL)= {!varPublicID}</span></li></ul><p><br></p><p>To modify who receives this email, run the Unsubscribe Link Setup Flow.</p> + + errorEmailRichText + false + <p>There's an error in the <strong>Unsubscribe Link Quick </strong>flow.</p><p><br></p><p>Please check whether the Organization-Wide Email Address: <strong>{!Get_Unsubscribe_Link_Setup.Org_Wide_Email_Address__c}</strong>,<strong> </strong>specified on the Unsubscribe Link Setup record exist in Setup and it's Status is <strong>Verified</strong>.</p><p><br></p><p><span style="background-color: rgb(255, 255, 255);">The Flow is part of an unmanaged package called Unsubscribe Link from the App Exchange.</span></p> + contactCollection SObject diff --git a/force-app/main/default/objects/Contact/fields/Unsubscribe_Url_Plain_Text__c.field-meta.xml b/force-app/main/default/objects/Contact/fields/Unsubscribe_Url_Plain_Text__c.field-meta.xml new file mode 100644 index 0000000..eed9499 --- /dev/null +++ b/force-app/main/default/objects/Contact/fields/Unsubscribe_Url_Plain_Text__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Unsubscribe_Url_Plain_Text__c + Returns a plain text version of the url that can be used in emails. + false + LEFT(Part1_Unsubscribe_Link__c , FIND("+",Part1_Unsubscribe_Link__c ) - 1) + BlankAsZero + + false + Text + false + diff --git a/force-app/main/default/objects/Lead/fields/Unsubscribe_Url_Plain_Text__c.field-meta.xml b/force-app/main/default/objects/Lead/fields/Unsubscribe_Url_Plain_Text__c.field-meta.xml new file mode 100644 index 0000000..9506eca --- /dev/null +++ b/force-app/main/default/objects/Lead/fields/Unsubscribe_Url_Plain_Text__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Unsubscribe_Url_Plain_Text__c + Holds the plain text value of the url. This is used to add the url to plain text emails. + false + LEFT(Part1_Unsubscribe_Link__c , FIND("+",Part1_Unsubscribe_Link__c ) - 1) + BlankAsZero + + false + Text + false + diff --git a/force-app/main/default/objects/Unsubscribe__c/Unsubscribe__c.object-meta.xml b/force-app/main/default/objects/Unsubscribe__c/Unsubscribe__c.object-meta.xml index 4641999..215453e 100644 --- a/force-app/main/default/objects/Unsubscribe__c/Unsubscribe__c.object-meta.xml +++ b/force-app/main/default/objects/Unsubscribe__c/Unsubscribe__c.object-meta.xml @@ -143,7 +143,7 @@ false SYSTEM Deployed - Manage unsubscribes from email lists. Part of unmanaged package Unsubscribe Link from Salesforce Labs. Each record represents a time a user attempted to Unsubscribe from commercial email. + Manage unsubscribes from email lists. Each record represents a time a user attempted to Unsubscribe from commercial email. true true false diff --git a/force-app/main/default/permissionsets/Unsubscribe_Link.permissionset-meta.xml b/force-app/main/default/permissionsets/Unsubscribe_Link.permissionset-meta.xml index 5348194..eb1b2c9 100644 --- a/force-app/main/default/permissionsets/Unsubscribe_Link.permissionset-meta.xml +++ b/force-app/main/default/permissionsets/Unsubscribe_Link.permissionset-meta.xml @@ -6,19 +6,24 @@ Contact.HasOptedOutOfEmail true + + true + Contact.Part1_Unsubscribe_Link__c + true + false Contact.Public_Id__c true - true - Contact.Part1_Unsubscribe_Link__c + false + Contact.Unsubscribe_Link_Contact__c true false - Contact.Unsubscribe_Link_Contact__c + Contact.Unsubscribe_Url_Plain_Text__c true @@ -26,19 +31,24 @@ Lead.HasOptedOutOfEmail true + + true + Lead.Part1_Unsubscribe_Link__c + true + false Lead.Public_Id__c true - true - Lead.Part1_Unsubscribe_Link__c + false + Lead.Unsubscribe_Link_Lead__c true false - Lead.Unsubscribe_Link_Lead__c + Lead.Unsubscribe_Url_Plain_Text__c true @@ -148,7 +158,7 @@ false false - false + true true false Contact @@ -157,7 +167,7 @@ false false - false + true true false Lead diff --git a/sfdx-project.json b/sfdx-project.json index 3896fe3..478c634 100644 --- a/sfdx-project.json +++ b/sfdx-project.json @@ -4,13 +4,13 @@ "path": "force-app", "package": "Unsubscribe Link", "versionName": "ver 0.1.NEXT", - "versionNumber": "0.1.0.NEXT", + "versionNumber": "0.1.1.NEXT", "default": true, "versionDescription": "" }, { "versionName": "ver 0.1", - "versionNumber": "0.1.0.NEXT", + "versionNumber": "0.1.1.NEXT", "definitionFile": "config/scratch-org-def.json", "path": "unsubscribe", "default": false,