After integrating the Frisbii payment link into the PDF invoice template with Vijay, Linda presents this change to the Finance team. Everyone is excited to be able to use this new payment method.
After the presentation, a discussion begins about whether they could also send this link directly to their customers via email?
The payment link
There are two ways to fill in the field Payment Link on the invoice.
One payment, one link
If you only generate one payment per invoice, there is a 1:1 relationship between the invoice and the payment.
The link displayed on the invoice, in the invoice PDF, and in the email template is the same as the link displayed on the payment.
In combination with payment schedules
If you use payment schedules, the situation is more complex. The field Payment Link on the invoice is populated as follows:
You have multiple pending payments on the invoice after creating the schedule.
The payment link originally comes from the payment with the payment date closest to the invoice date.
As soon as this payment is no longer pending, the code generates the link to the second payment (depending on the date).
If you have created more than two payments, the link is repeated in the same way until the last payment is no longer marked as outstanding.
Let's look at how you can send this payment method to your customers.
The new Email Templates
Linda returns to her sandbox to take a closer look at the email templates. Sure enough, she finds a new folder called PSP (Payment Service Provider).
Steps
1. Go to Setup using the gear icon in the top right.
2. Enter the word template to find the Classic Email Templates.
3. Open the PSP folder.
In the soon future these templates will be translated into English.
Add the payment link to your custom templates
Attention! To add the invoice's merge field values to an email template, you have to rename the invoice object. Salesforce also natively provides an object of this name (Invoice), which means that only the merged value fields of this Salesforce object are accessible via the classic email template interface.
Important: Once renamed, you cannot go back and rename the invoice object because there is a Salesforce object with the same name. If you attempt to reset the object's name, you will receive an error message.
Linda anticipates the team's question about whether it's possible to integrate the link into a custom template. After renaming the Invoice object, she proceeds as follows:
Steps
1. Go to Setup using the gear icon in the top right.
2. Enter "Template" to find the Classic email templates.
3. Open the template in question.
4. Using the merge fields available in the interface:
Select a field type: Name you chose for the Invoice object - Fields
Select a field: Customer Payment URL
Copy the suggested value {!sofactoapp__Factures_Client__c.sofactoapi__clientPaymentStripeURL__c} into your message body.
IMPORTANT: Starting with version 4.3, the API name of the field is sofactoapp__clientPaymentPspURL__c, so the suggested value is {!sofactoapp__Factures_Client__c.sofactoapp__clientPaymentPspURL__c}.
Now you know how to insert the link into your emails.