The package can send a styled verification email when a Contact receives a new Temporary Password. Delivery is opt-in, so upgrades do not automatically duplicate existing email alerts or flows. Incorrect verification codes no longer generate replacement codes.
In Setup, open Custom Settings → Portal → Manage. Set organization defaults, or an override for the site's guest user or profile.
| Setting | Purpose |
|---|---|
Send verification email (b3p__Send_Verification_Email__c) |
Enables the packaged sender. Default: unchecked. |
Verification email sender (b3p__Verification_Email_Sender__c) |
Exact verified organization-wide email address used as the From address. Required when delivery is enabled. |
Verification email template (b3p__Verification_Email_Template__c) |
Active Classic custom HTML or text email template unique name, not its display label or record ID. Blank selects the packaged b3p__Portal_Verification_Code. For an unpackaged copy, use its unique name without a namespace. |
Site URL (b3p__Site_URL__c) |
Optional. An extra trusted base for the return link (see Return link and code prefill), and the [[PORTAL_URL]] fallback for branded templates that have no link markers. Must be HTTPS when set. |
Enable Passkeys (b3p__Passkeys_Enabled__c) |
Includes passkey registration, sign-in and security guidance in the email. Complete the separate passkey origin setup before enabling passkeys. |
Maximum incorrect code attempts (b3p__Max_Incorrect_Code_Attempts__c) |
Number of consecutive failed code submissions allowed before disabling the Contact. Default: 3. Blank or values below 1 also use 3. |
All setup is available in Salesforce Setup. No CLI, Tooling API, subscriber user or customer-authored Flow is required.
portal@company.com. Give it an appropriate display name.Example settings:
| Setting | Example |
|---|---|
| Send verification email | Checked |
| Verification email sender | portal@company.com |
| Verification email template | Leave blank for the packaged template |
| Site URL | https://portal.company.com |
| Enable Passkeys | Match the portal's passkey configuration |
| Maximum incorrect code attempts | 3 |
The package includes the active Portal verification email Flow (b3p__Portal_Verification_Email). Customers do not need to edit or clone it. The Flow uses Salesforce's Send Email action with Organization-Wide Email Address as the sender type. This is the supported sender configuration for guest users. See Salesforce Send Email action.
Guest transactions publish b3p__Portal_Verification_Email__e after commit. The packaged Flow processes the event separately. Events carry a Contact reference, requesting user reference and the trusted source page (b3p__Source_URL__c), not the verification code itself. Preparation reads the requesting user's effective Portal settings and current Contact code. Consumed, replaced, previously submitted and disabled-Contact requests are ignored. Turning the enable checkbox off also skips pending requests when they are processed.
The Flow prepares and sends each email in the same transaction. Its duplicate-delivery marker commits only if the transaction succeeds. An error from Send Email rolls back that marker. The marker means Salesforce accepted the send transaction, not that the recipient's mailbox received it; later bounces are outside this transaction.
If no email arrives, check:
A Flow error email reading Value of class java.lang.Boolean is not a ValueType: ANYTYPE at Send_if_current comes from package versions up to 12.2. Those versions stored the Apex action outputs automatically, and the outputs lost their types in subscriber orgs. 12.2.1 and later map each output to a typed Flow variable. Upgrade the package and confirm the new Flow version is active. Nothing can be changed in the org to work around it.
After correcting a delivery error, request a new code through the portal. Failed sends are not automatically retried. Do not edit the packaged Flow to add fault paths that continue successfully after a send failure or split preparation and sending across transactions; doing so can commit a delivery marker for an unsent email.
The Flow sends composed content and does not log the verification email to Contact activity history. This avoids retaining the code in email activity records. Salesforce's Send Email action applies its workflow email allocation when neither a template ID nor email logging is supplied. The package merges the selected template before calling that action. See Salesforce email action limits.
Guest users do not need direct API or subscription access to the platform event. Do not grant guests access to authentication event messages. If an implementation uses a manually maintained guest permission set, include access to the b3p.PortalVerificationEmail Apex class used by the packaged Flow.
In Classic Email Templates, copy Portal verification code from Portal emails to an editable public folder, keeping the Custom HTML template type. Change the logo, wording, fonts and inline styles, activate the copy, and enter its unique name in Verification email template.
The packaged sender supports Classic custom HTML and Classic text templates with direct Contact field references such as {!Contact.FirstName} and {!Contact.b3p__Temporary_Password__c}. Blank field values become empty text, and HTML field values are escaped. Relationship paths such as {!Contact.Account.Name}, merge formulas and global merge fields such as {!$User.Name} are not supported. It does not supply a related record. Visualforce, Lightning and letterhead-based templates are not supported by this delivery path. For custom HTML templates the Flow sends the HTML body; for text templates it sends the text body. Preserve these values in the body that is sent:
| Value | Meaning |
|---|---|
{!Contact.b3p__Temporary_Password__c} |
Current verification code. |
[[PORTAL_URL]] |
Replaced with the return link to the source page, escaped for HTML where appropriate. With no source page, replaced with Site URL (or empty text). |
[[PORTAL_LINK_START]] … [[PORTAL_LINK_END]] |
Wrap the portal button. The markers are removed when a source page was captured; with no source page the whole section, markers included, is removed. |
[[PASSKEY_NOTICE]] |
Replaced with passkey guidance when enabled, or an empty string when disabled. |
The packaged sender expands the bracketed tokens using Portal settings and merges direct Contact fields in bulk. A Salesforce template preview alone will show the tokens. Avoid hard-coding passkey guidance in a branded template, since hard-coded text cannot be conditionally removed.
When a visitor requests a code or registers, the login component sends the page they are on (origin, path and #route, without the query string). The server keeps it only when it is HTTPS and starts with the current site's base URL or with Site URL from Portal settings; anything else is discarded, so the email link always points at your own site.
The accepted URL is also written to Source URL (b3p__Source_URL__c) on the Registration or Access Code Request Web Event, so you can report on which portal pages users sign in from. That field holds up to 255 characters; the email link uses the full URL.
The email button then opens that exact page with the login prefilled:
Requested from: https://portal.example.com/vms/b3p__Portal#TestPage
Email link: https://portal.example.com/vms/b3p__Portal?username=jo%40example.com&vericode=ABC123#TestPage
On load the login component removes vericode from the address bar and browser history, opens the code step with the email and code filled in, and waits for the visitor to select Verify Code. It does not sign in automatically. The code is single use and stops working once used, replaced or locked out.
If no trusted source page was captured (for example, an administrator set the Temporary Password directly), the button section is hidden. Branded copies made before 12.4 have no link markers, so their button still points at Site URL without the code; add [[PORTAL_LINK_START]] and [[PORTAL_LINK_END]] around the button to adopt the new behaviour.
Both normal code login and email verification for passkey registration use the same counter and lockout. Simultaneous submissions are counted correctly, and a code can be used successfully only once.
| Contact field | Meaning |
|---|---|
Last code login attempt (b3p__Last_Login_Attempt__c) |
Date/time of the latest verification-code submission for a known Contact. |
Last code login status (b3p__Last_Login_Status__c) |
Successful, Incorrect code or Locked out. This tracks code verification, not every passkey, session or kiosk login. |
Incorrect code attempts (b3p__Incorrect_Code_Attempts__c) |
Consecutive incorrect submissions. Successful verification resets it to zero. Requesting another code does not reset it. |
Disabled Portal User (b3p__Disabled_Portal_User__c) |
Checked when the limit is reached. The outstanding code is cleared and portal access is disabled, including existing session access and passkey login. |
Add the attempt, status, counter and Disabled Portal User fields to the Contact page layout used by support administrators. The Portals Admin permission set grants access to the new support fields.
To restore access after confirming the user's identity, set Incorrect code attempts to 0 and clear Disabled Portal User. Save both changes together, then ask the user to request a new verification code. Do not clear a pre-existing administrative disable without investigating its reason. Raising the configured limit does not clear an existing disabled flag.
The lockout message asks the user to contact their administrator. Before the limit is reached, an incorrect code leaves the current code unchanged and displays the invalid-code message. Empty codes and submissions without an outstanding code also count as failures.