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/.vscode/settings.json b/.vscode/settings.json index 352227e..5000573 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -26,5 +26,6 @@ "**/.settings": true, "**/.exchange_modules_tmp": true, ".mule": true - } + }, + "xml.preferences.showSchemaDocumentationType": "none" } 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/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/flows/Unsubscribe_Link_Setup.flow-meta.xml b/force-app/main/default/flows/Unsubscribe_Link_Setup.flow-meta.xml index 9f92119..185a616 100644 --- a/force-app/main/default/flows/Unsubscribe_Link_Setup.flow-meta.xml +++ b/force-app/main/default/flows/Unsubscribe_Link_Setup.flow-meta.xml @@ -3,8 +3,8 @@ Contact_Batch - 577 - 4010 + 0 + 0 UUIDBatchInvocable apex @@ -30,13 +30,12 @@ UUIDBatchInvocable - 1 LeadBatch - 577 - 4118 + 0 + 0 UUIDBatchInvocable apex @@ -62,14 +61,13 @@ UUIDBatchInvocable - 1 - 61.0 + 64.0 ass_final_value_of_sender_email - 445 - 1238 + 0 + 0 var_FinalRecord.Org_Wide_Email_Address__c Assign @@ -91,8 +89,8 @@ ass_final_value_of_sender_email_0 - 709 - 1022 + 0 + 0 var_FinalRecord.Org_Wide_Email_Address__c Assign @@ -115,8 +113,8 @@ Assign selections made on previous screens Assign_Modified_Value - 577 - 3494 + 0 + 0 var_FinalRecord.Screen_1_Part_2__c Assign @@ -188,8 +186,8 @@ Assign values to the default if this is their first time creating a record. Default_AssignValues - 709 - 506 + 0 + 0 var_FinalRecord.Screen_3__c Assign @@ -289,8 +287,8 @@ Assign values to the final variable if this is their second or later time filling this out. EXISTINGAssignValues - 445 - 398 + 0 + 0 var_FinalRecord.Screen_3__c Assign @@ -390,8 +388,8 @@ Assign values to the final variable based on answers to the initial screen. UpdateFinalValues - 578 - 1373 + 0 + 0 var_FinalRecord.Confirmation_Email_Text__c Assign @@ -460,8 +458,8 @@ Confirmation_EmailSend - 577 - 2978 + 0 + 0 Get_Experience_Site @@ -485,8 +483,8 @@ dec_Org_wide_confirmation_email_sender - 577 - 914 + 0 + 0 ass_final_value_of_sender_email_0 @@ -511,10 +509,10 @@ Does a setup record exist already ExistingRecordSameName_0 - 577 - 290 + 0 + 0 - CompanyName + Welcome_Screen No record @@ -528,7 +526,7 @@ - EXISTINGAssignValues + WelcomeBack @@ -537,8 +535,8 @@ Does a setup record exist already ExistingRecordSameName_0_0 - 577 - 3602 + 0 + 0 Create_Record @@ -562,8 +560,8 @@ Include_screen_1 - 577 - 2270 + 0 + 0 Screen2PreviewScreen_0 @@ -587,8 +585,8 @@ IncludeScreen3Decision - 577 - 2678 + 0 + 0 Confirmation_EmailSend @@ -609,7 +607,7 @@ - Included creating an org wide email address for confirmation email sender. And profile security. + This flow is run to configure or reconifgure the unusubscribe link setup object. It must be run prior to using the unsubscribe link in Emails. Pick another org wide email to get an error message. ErrorEmailAddress @@ -633,27 +631,13 @@ senderOrgWideEmails String - DisplayName - 1 AND (2 OR 3) - - IsVerified - EqualTo - - true - - - - Purpose - EqualTo - - DefaultNoreply - - + Address + and Purpose - EqualTo + NotEqualTo - UserSelectionAndDefaultNoReply + UserSelection OrgWideEmailAddress @@ -693,7 +677,7 @@ CanvasMode - FREE_FORM_CANVAS + AUTO_LAYOUT_CANVAS @@ -707,8 +691,8 @@ Create the Org wide email address used by the confirmation email as the sender. Create_Org_Wide_Email_0 - 445 - 1022 + 0 + 0 ass_final_value_of_sender_email @@ -743,8 +727,8 @@ Create the UL record. Create_Record - 709 - 3710 + 0 + 0 Create_Public_Ids @@ -754,8 +738,8 @@ Collect Experience Site informations Get_Experience_Site - 577 - 3278 + 0 + 0 false Get_My_Domain @@ -768,8 +752,8 @@ Collect URL from Experience Site Get_My_Domain - 577 - 3386 + 0 + 0 false Assign_Modified_Value @@ -789,8 +773,8 @@ getULSetup - 577 - 182 + 0 + 0 false ExistingRecordSameName_0 @@ -802,8 +786,8 @@ Update_existing_record - 445 - 3710 + 0 + 0 Create_Public_Ids @@ -812,8 +796,8 @@ CompanyName - 709 - 398 + 0 + 0 false true false @@ -821,43 +805,20 @@ Default_AssignValues - CompanyName_Section1 - RegionContainer - - CompanyName_Section1_Column1 - Region - - FinalOrgName - String - - $Organization.Name - - What is your organization or company name? - InputField - UseStoredValues - false - - - width - - 6 - - - false - - - CompanyName_Section1_Column2 - Region - - width - - 6 - - - false - + S01_T01_CompanyNameInstructions + <p><strong style="font-size: 16px;">Set Company Name</strong></p><p><br></p><p>When someone clicks the unsubscribe link they will see a confirmation page that includes your company's name.</p><p>We have pre-populated the text with the name listed in Setup under Company Info but you may customize it here, if desired.</p> + DisplayText + + + FinalOrgName + String + + $Organization.Name + + Company name as it will appear on the unsubscribe confirmation page: + InputField + UseStoredValues false - SectionWithoutHeader Next true @@ -866,25 +827,26 @@ completeScreen - 577 - 4226 - true + 0 + 0 + false true - true + false DonedisplayText - <p><span style="font-size: 20px;">You are done!</span></p> + <p><strong style="font-size: 16px;">You are done! </strong></p><p>Click 'Finish' to complete setup. If you need to make any changes, you can always come back to this flow and modify your configuration.</p> DisplayText + Finish true false ConfirmationEmailPreviewScreen - 445 - 3086 - true + 0 + 0 + false true false @@ -892,7 +854,7 @@ confirmationEmailDisplayText - <p><strong style="font-size: 20px;">PREVIEW</strong></p><p><em>The email recipient receives an email. </em></p><p>{!horizontalLine1}</p><p><br></p><p><span style="font-size: 20px;">From: {!varT_OrgWideEmailDisplayName}</span></p><p><span style="font-size: 20px;">Email body: {!ConfirmEmailText}</span></p> + <p><strong style="font-size: 16px;">PREVIEW</strong></p><p><em>If you opted to send a confirmation email, the recipient receives a message that looks like this. </em></p><p>{!horizontalLine1}</p><p><br></p><p><span style="font-size: 20px;">From: {!varT_OrgWideEmailDisplayName}</span></p><p><span style="font-size: 20px;">Email body: {!ConfirmEmailText}</span></p><p><br></p> DisplayText true @@ -901,9 +863,9 @@ Create_Public_Ids - 577 - 3902 - true + 0 + 0 + false true false @@ -911,19 +873,19 @@ displayPublicIds - <p><span style="font-size: 18px;">Great! That part is done.</span></p><p><br></p><p><span style="font-size: 18px;">Last step</span></p><p>The Unsubscribe Link uses a 64 digit random id on each contact and lead, called Public_Id__c.</p><p>This may take a little while. You will receive an email when it is done.</p><p>After this, two record triggered flows will automatically create public ids when new contacts and leads are created.</p><p><br></p><p><span style="color: rgb(68, 68, 68); background-color: rgb(255, 255, 255);">Click next to populate the public ids on all your records now.</span></p> + <p><strong style="font-size: 16px;">Great! That part is done.</strong></p><p><br></p><p><strong style="font-size: 16px;">Last step</strong></p><p><span style="color: rgb(0, 0, 0);">The Unsubscribe Link uses a 64 digit random id on each contact and lead, called Public_Id__c.</span></p><p><span style="color: rgb(0, 0, 0);">This may take a little while. You will receive an email when it is done.</span></p><p><span style="color: rgb(0, 0, 0);">After this, two record triggered flows will automatically create public ids when new contacts and leads are created.</span></p><p><br></p><p><span style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);">Click next to populate the public ids on all your records now.</span></p> DisplayText true - true + false A preview of the email with the option to modify the text of the link EmailModifyScreen - 578 - 1565 - true + 0 + 0 + false true false @@ -931,7 +893,7 @@ SampleEmailDisplayText_0 - <p><strong style="font-size: 22px;"><u></u>PREVIEW</strong></p><p><em>Your email recipient gets an email like this with an unsubscribe link at the bottom. </em></p><p>{!horizontalLine1}</p><p><br></p><p><span style="font-size: 20px;">Dear Friend,</span></p><p><br></p><p><span style="font-size: 20px;">It's Thursday! You love to order a pizza on Thursdays! If you order before 5, I'll also throw in some free drinks!</span></p><p><br></p><p><span style="font-size: 20px;">Your friend,</span></p><p><span style="font-size: 20px;">Bob</span></p><p><br></p><p><u style="color: rgb(2, 54, 244); font-size: 20px;">{!var_FinalRecord.Link_Text__c}</u></p> + <p><strong style="font-size: 16px;"><u></u>PREVIEW</strong></p><p><em>Your email recipient gets an email like this with an unsubscribe link at the bottom. </em></p><p>{!horizontalLine1}</p><p><br></p><p><span style="font-size: 20px;">Dear Friend,</span></p><p><br></p><p><span style="font-size: 20px;">It's Thursday! You love to order a pizza on Thursdays! If you order before 5, I'll also throw in some free drinks!</span></p><p><br></p><p><span style="font-size: 20px;">Your friend,</span></p><p><span style="font-size: 20px;">Bob</span></p><p><br></p><p><u style="color: rgb(2, 54, 244); font-size: 20px;">{!var_FinalRecord.Link_Text__c}</u></p> DisplayText @@ -957,9 +919,9 @@ Give the option to have a confirmation screen before Opt Out, but this is not recommended. Screen1Preview - 445 - 2378 - true + 0 + 0 + false true false @@ -967,7 +929,7 @@ Screen1PreviewDisplayText - <p><strong style="font-size: 20px;">PREVIEW</strong></p><p><em style="color: rgb(68, 68, 68); background-color: rgb(255, 255, 255);">This page allows the recipient to confirm before opting out. </em></p><p><span style="color: rgb(68, 68, 68); background-color: rgb(255, 255, 255);">{!horizontalLine1}</span></p><p><br></p><p><span style="font-size: 20px;">{!var_FinalRecord.Screen_1_Part_1__c} georgeB@bbbl.org </span><span style="font-size: 20px; background-color: rgb(255, 255, 255); color: rgb(68, 68, 68);">{!var_FinalRecord.Screen_1_Part_2__c} </span></p> + <p><strong style="font-size: 16px;">PREVIEW</strong></p><p><em style="background-color: rgb(255, 255, 255); color: rgb(68, 68, 68);">This page allows the recipient to confirm before opting out. </em></p><p><span style="background-color: rgb(255, 255, 255); color: rgb(68, 68, 68);">{!horizontalLine1}</span></p><p><br></p><p><span style="font-size: 20px;">{!var_FinalRecord.Screen_1_Part_1__c} georgeB@bbbl.org </span><span style="font-size: 20px; color: rgb(68, 68, 68); background-color: rgb(255, 255, 255);">{!var_FinalRecord.Screen_1_Part_2__c} </span></p> DisplayText @@ -976,62 +938,23 @@ DisplayText - Screen1Preview_Section1 - RegionContainer - - Screen1Preview_Section1_Column1 - Region - - EnableOneClick - Yes - No - String - - var_FinalRecord.Confirmation_Page__c - - Do you want to include this confirmation page? - DropdownBox - UseStoredValues - true - - - width - - 4 - - - false - - - Screen1Preview_Section1_Column2 - Region - - width - - 4 - - - false - - - Screen1Preview_Section1_Column3 - Region - - width - - 4 - - - false - - false - SectionWithoutHeader + EnableOneClick + Yes + No + String + + var_FinalRecord.Confirmation_Page__c + + Do you want to include this confirmation page? + DropdownBox + UseStoredValues + true - Screen1Preview_Section2 + Screen1Preview_Section1 RegionContainer - Screen1Preview_Section2_Column1 + Screen1Preview_Section1_Column1 Region ModifyScreen1Part1 @@ -1053,7 +976,7 @@ false - Screen1Preview_Section2_Column2 + Screen1Preview_Section1_Column2 Region ModifyScreen1Part2 @@ -1075,7 +998,7 @@ false - Screen1Preview_Section2_Column3 + Screen1Preview_Section1_Column3 Region width @@ -1105,9 +1028,9 @@ This screen will display the confirmation message you want the user to see Screen2PreviewScreen_0 - 577 - 2570 - true + 0 + 0 + false true false @@ -1115,12 +1038,12 @@ screen2previewDisplayText_0 - <p><strong style="font-size: 20px;">PREVIEW</strong><span style="font-size: 20px;"> </span></p><p>{!horizontalLine1}</p><p><br></p><p><span style="font-size: 20px; color: rgb(0, 0, 0);">{!var_FinalRecord.Screen_2_Part_1__c} {!frm_screen2part2}</span></p> + <p><strong style="font-size: 16px;">PREVIEW</strong><span style="font-size: 16px;"> </span></p><p><em style="background-color: rgb(255, 255, 255);">This is what the email recipient will see on the confirmation page after they have been unsubscribed. </em></p><p>{!horizontalLine1}</p><p><br></p><p><span style="font-size: 20px; color: rgb(0, 0, 0);">{!var_FinalRecord.Screen_2_Part_1__c} {!frm_screen2part2}</span></p> DisplayText displayTextHozLine - <p><br></p><p><br></p><p><br></p><p><br></p><p><span style="background-color: rgb(255, 255, 255); color: rgb(68, 68, 68);">{!horizontalLine1}</span></p> + <p><br></p><p><span style="background-color: rgb(255, 255, 255); color: rgb(68, 68, 68);">{!horizontalLine1}</span></p> DisplayText @@ -1192,17 +1115,17 @@ This is an optional screen to allow user to enter their email if not found in the database. Screen3PreviewScreen - 445 - 2786 - true + 0 + 0 + false true - true + false Confirmation_EmailSend screen3previewDisplayText - <p><strong style="font-size: 20px;">PREVIEW</strong></p><p><em>If the email recipient's ID was not found, they can enter their email address here. You can turn off this feature. </em></p><p>{!horizontalLine1}</p> + <p><strong style="font-size: 16px;">PREVIEW</strong></p><p><em>If the email recipient's ID was not found, they can enter their email address here. You can turn off this feature. </em></p><p>{!horizontalLine1}</p> DisplayText @@ -1269,130 +1192,108 @@ Select informations to set up the unsubscribe link Set_Up_Unsubscribe_Link_0 - 577 - 698 - true + 0 + 0 + false true false dec_Org_wide_confirmation_email_sender - Set_Up_Unsubscribe_Link_0_Section1 - RegionContainer - - Set_Up_Unsubscribe_Link_0_Section1_Column1 - Region - - Company_Name - String - - var_FinalRecord.Our_Organization__c - - Company Name - InputField - UseStoredValues - false - - and - - RecordExists - EqualTo - - true - - - - - - confirmEmailQ - Yes - No - String - - var_FinalRecord.Send_Confirmation_Email__c - - Do you want to send a confirmation email immediately after the email recipient opts out? - DropdownBox - UseStoredValues - true - - - OrgWideEmailQ - senderOrgWideEmails - Create_an_org_wide_email_now - String - - var_FinalRecord.Org_Wide_Email_Address__c - - Choose an organization wide email address for this email to appear from. - DropdownBox - UseStoredValues - true - - and - - confirmEmailQ - EqualTo - - Yes - - - - - - ConfirmEmailText - String - - var_FinalRecord.Confirmation_Email_Text__c - - What should the email say? - InputField - <p>Example text: You have successfully unsubscribed from all email from &lt;insert company name&gt;.</p> - UseStoredValues - false - - and - - confirmEmailQ - EqualTo - - Yes - - - - - - width - - 6 - - - false - - - Set_Up_Unsubscribe_Link_0_Section1_Column2 - Region - - width - - 6 - - - false - + dis_BasicSetup + <p><strong style="font-size: 16px;">Basic Settings</strong></p> + DisplayText + + + Company_Name + String + + var_FinalRecord.Our_Organization__c + + Company Name + InputField + <p>When someone clicks the unsubscribe link they will see a confirmation page that includes your company's name.</p> + UseStoredValues false - SectionWithoutHeader + + and + + RecordExists + EqualTo + + true + + + + + + confirmEmailQ + Yes + No + String + + var_FinalRecord.Send_Confirmation_Email__c + + Do you want to send a confirmation email immediately after the email recipient opts out? + DropdownBox + UseStoredValues + true - Set_Up_Unsubscribe_Link_0_Section2 + OrgWideEmailQ + senderOrgWideEmails + Create_an_org_wide_email_now + String + + var_FinalRecord.Org_Wide_Email_Address__c + + Choose an organization wide email address for this email to appear from. + DropdownBox + UseStoredValues + true + + and + + confirmEmailQ + EqualTo + + Yes + + + + + + ConfirmEmailText + String + + var_FinalRecord.Confirmation_Email_Text__c + + What should the email say? + InputField + <p>Example text: You have successfully unsubscribed from all email from &lt;insert company name&gt;.</p> + UseStoredValues + false + + and + + confirmEmailQ + EqualTo + + Yes + + + + + + Set_Up_Unsubscribe_Link_0_Section1 RegionContainer - Set_Up_Unsubscribe_Link_0_Section2_Column1 + Set_Up_Unsubscribe_Link_0_Section1_Column1 Region dis_CreateOrgWide - <p><strong><u>Create organization wide email address</u></strong></p> + <p><strong style="font-size: 16px;">Create Organization Wide Email Address</strong></p> DisplayText @@ -1436,18 +1337,7 @@ width - 6 - - - false - - - Set_Up_Unsubscribe_Link_0_Section2_Column2 - Region - - width - - 6 + 12 false @@ -1467,62 +1357,108 @@ OneClickdisplaytext - <p>{!horizontalLine1}</p><p><strong><u>Allow Recipients to Type-In Email Address</u></strong></p><p><span style="font-size: 14px; background-color: transparent;">The unsubscribe link passes the contact or lead's Salesforce id to a flow. Sometimes an email recipient's security settings block or scramble the ID. You can allow your recipients to type in their email addresses to unsubscribe in that situation. BE CAREFUL! This allows anyone who has the link and knows any email addresses in your database to unsubscribe them. For example, if a bad guy knows that joeschmoe@ymail.com loves your newsletters and that bad guy dislikes your organization, then he could potentially unsubscribe Joe Schmoe from your newsletter!&nbsp;</span></p> + <p>{!horizontalLine1}</p><p><strong style="font-size: 16px;">Allow Recipients to Type-In Email Address</strong></p><p><br></p><p>The unsubscribe link passes the contact or lead's Salesforce id to a flow. Sometimes an email recipient's security settings block or scramble the ID. You can allow your recipients to type in their email addresses to unsubscribe in that situation. BE CAREFUL! This allows anyone who has the link and knows any email addresses in your database to unsubscribe them. For example, if a bad guy knows that joeschmoe@ymail.com loves your newsletters and that bad guy dislikes your organization, then he could potentially unsubscribe Joe Schmoe from your newsletter!</p> DisplayText - Set_Up_Unsubscribe_Link_0_Section3 - RegionContainer - - Set_Up_Unsubscribe_Link_0_Section3_Column1 - Region - - type_in_unsubscribe - Yes - No - String - - var_FinalRecord.Enable_Type_in_Email_Address__c - - Allow recipient to type in email - DropdownBox - UseStoredValues - true - - - width - - 4 - - - false - - - Set_Up_Unsubscribe_Link_0_Section3_Column2 - Region - - width - - 8 - - - false - - false - SectionWithoutHeader + type_in_unsubscribe + Yes + No + String + + var_FinalRecord.Enable_Type_in_Email_Address__c + + Allow recipient to type in email + DropdownBox + UseStoredValues + true Next true false + + Welcome_Screen + + 0 + 0 + true + true + true + + CompanyName + + + S00_T00_Welcome + <p><strong style="font-size: 16px;">Welcome to Setup</strong></p><p><br></p><p>Please make sure you review and complete the <strong>Set Up Instructions</strong> before moving forward with this configuration. Once ready, this flow will walk you through the necessary steps to get started!</p> + DisplayText + + true + false + + + WelcomeBack + + 0 + 0 + false + true + false + + EXISTINGAssignValues + + + S00_T00_WelcomeBack + <p><strong style="font-size: 16px;">Welcome Back to Setup</strong></p><p><br></p><p>If you would like to update your configuration of Unsubscribe Link, you may continue to reconfigure settings.</p> + DisplayText + + true + false + + + Complete + true + + 25 + + + Confirmation + true + + 15 + + + Email_Preview + true + + 10 + + + Initial_Configuration + true + + 5 + + + Public_IDs + true + + 20 + + + Welcome + true + + 0 + - 451 - 48 + 0 + 0 getULSetup - Draft + Active horizontalLine1 true 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,