--- title: "Use Cases" slug: "paylink-use-cases" updated: 2022-07-13T20:56:20Z published: 2022-07-13T20:56:20Z canonical: "docs.blackthorn.io/paylink-use-cases" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.blackthorn.io/llms.txt > Use this file to discover all available pages before exploring further. # Use Cases ## Automated PayLink with Opportunities ### Scenario A common use case is that a salesperson will close an Opportunity and send the customer a link to the payment request. To do this, you can build three things all without code: - A Process Builder process to automatically create a Transaction record when the Opportunity Stage = "Closed Won". - A Process Builder process to automatically roll-up the PayLink on to the Opportunity record. - A Workflow Rule with an Email Alert to automatically email the PayLink to the customer. ### Instructions #### Step One - Create a custom URL type field on the Opportunity object called `PayLink`. - Create a lookup type field on the Opportunity object called `Billing Contact` that looks to the Contact object and is filtered by the Account record on the Opportunity. *This is for sending a Workflow email all from one object (Opportunity). Alternatively, roll-up a related Contact Role record from the Opportunity to populate this value too.* ![L_06_automated paylink pic 1](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_automated%20paylink%20pic%201.png) #### Step Two *Auto-create the Blackthorn | Payments Transaction from the "Closed Won" Opportunity.* ![L_06_automated paylink pic 2](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_automated%20paylink%20pic%202.png) - Create a new Process Builder. *The process starts when **A record changes**.* - Click the "+ Add Object", type in "Opportunity", and select "when a record is created or edited". - Save. - Click the "+ Add Criteria", name your criteria and select " Conditions are met". - Under field, find Opportunity `Stage`, set to "Equals", and pick "Closed Won" for the value. - Under Immediate Actions, click "+ Add Action". - Action Type = Create a Record, name your action and Record Type = "Transaction". - Set Field Values for five fields: ``` - Amount = Type: Formula, Value: Opportunity. Amount - Opportunity = Type: Reference, Value: Opportunity. ID - Description = Type: Formula, Value: Opportunity. Description - Due Date = Type: Formula, Value: Opportunity.CloseDate - Contact = Type: Reference, Value: Opportunity.Billing_Contact ``` *Alternatively to the `Contact` field, you can populate the `Account` lookup onto the Transaction with the Opportunity `Account`. Just note, if you want both lookup fields on the Transaction, the `Account` lookup will supersede the `Contact` lookup when viewing the PayLink form.* ![L_06_automated paylink pic 3](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_automated%20paylink%20pic%203.png) #### Step Three - After the Immediate Action, select "Evaluate The Next Criteria". - Click the "+ Add Criteria", name your criteria "Amount is changed" and select " Conditions are met". - Set Condition: Opportunity `Amount` field, Is Changed, Boolean, True ![L_06_automated paylink pic 4](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_automated%20paylink%20pic%204.png) - Under Immediate Actions, click "+ Add Action". - Action Type: Update a Record, name your action: Update Transaction Amount - Select No criteria-just update the records! - Set the field values: ``` - Amount: Type: Formula, Value: Opportunity. Amount ``` ![L_06_automated paylink pic 5](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_automated%20paylink%20pic%205.png) - Activate the Process Builder. #### Step Four *Auto roll-up the PayLink from Transaction to Opportunity. This will allow you to use the PayLink in the Email Alert.* - Create a new Process Builder. *The process starts when **A record changes**.* - Click the "+ Add Object", type in "Transaction", and select "only when a record is created". - Save. - Click the "+ Add Criteria", name your criteria and select " Conditions are met". - Under field, find Transaction `Opportunity`, set operator to "IS NULL", type to "Boolean" and pick "False" for the value. *This criteria is telling the process only to fire when the Transaction has a related Opportunity.* - Under Advanced, check "Yes". ![L_06_automated paylink pic 6](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_automated%20paylink%20pic%206.png) - Under Immediate Actions, click "+ Add Action". - Action Type = Update Records, name your action and select Record Type = "Opportunity". - No criteria-just update the records! - Field = `PayLink`, Type = Formula, Value = "bt_stripe**Transaction**c. bt_paylink**PayLink**c". - Activate the Process Builder. ![L_06_automated paylink pic 7](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_automated%20paylink%20pic%207.png) #### Step Five *Create a Workflow Rule with an Email Alert to automatically email the PayLink to the customer.* - Create the Email Template. *Here is an example Email Template.* ![L_06_automated paylink pic 8](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_automated%20paylink%20pic%208.png) - Create the Workflow Rule and Email Alert. This will email your customer when the Opportunity is "Closed Won" and there is a PayLink value. *Here is an example Workflow Rule and Email Alert.* ![L_06_automated paylink pic 9](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_automated%20paylink%20pic%209.png) --- ![L_06_automated paylink pic 10](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_automated%20paylink%20pic%2010.png) Boom! Done. --- ## Transaction Reattempt Notifications ### Failed Transaction Follow Up When Transactions fail and are reattempted, it is a good thing to follow up with the customer to notify them and update their card or bank account information if the Transaction continues to fail. *For the use case below, we will be creating a Process builder to send out an automated email notification to the customer after the second reattempt and then notify the sales rep on the third reattempt.* #### Step One Create an Email Template and Email Alert *These two records will be referenced later in a Process Builder.* - Example Email Template: ![L_06_transaction reattempt pic 1](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_transaction%20reattempt%20pic%201.png) - Example Email Alert: ![L_06_transaction reattempt pic 2](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_transaction%20reattempt%20pic%202.png) #### Step Two Create a Process Builder that will automatically send out the Email that we just created above and notify the Transaction owner. - Create a new Process Builder. *The process starts when **A record changes**.* - Click the "+ Add Object," type in "Transactions," and select "when a record is created or edited." - Save. - Click the "+ Add Criteria," name your criteria and select " Conditions are met." - Under field, find Transaction `Reattempt Number,` set to "Equals," and value of "2". - Under Immediate Actions, click "+ Add Action". - Action Type = Email Alerts, name your action and Email Alert = The name of your Email Alert you created above. - Click "Save." - Under "False" click the "+ Add Criteria," name your criteria and select " Conditions are met." - Under field, find Transaction `Reattempt Number,` set to "Equals," and value of "3". - Under Immediate Actions, click "+ Add Action". - Action Type = Post to Chatter, Action Name: "Notify Transaction Owner", Post To: This record. - Message: Enter any custom message you would like.*Example Message: @[{![bt_stripe__Transaction__c].OwnerId}] Contact the customer on this Transaction. Their Payment Method is incorrect and needs to be updated in order for the Transaction to process. An email has already been sent with a PayLink to update their Payment Method.* - Click "Save." - Click "Activate." ![L_06_transaction reattempt pic 3](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_transaction%20reattempt%20pic%203.png) --- ![L_06_transaction reattempt pic 4](https://cdn.document360.io/f977eec0-500f-40a3-b663-724a51f78075/Images/Documentation/L_06_transaction%20reattempt%20pic%204.png) *On third reattempt, Chatter post will automatically get created and notify the Transaction owner.*