portal_send_link()
Email one person a one-use portal sign-in link, using the portal's Sign-in link email. It is the same as pressing Send sign-in link under Portal settings, then People. The portal must have sign-in links turned on.
Syntax
portal_send_link(portalId, recordId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
portalId |
int | yes | The portal's id: the number at the end of its address in the portal builder, /portals/<id>. |
recordId |
int | yes | A record on the portal's sign-in table. Usually $record["_meta"]["id"]. Also accepts a whole record. |
Returns
The email address the link went to.
Example
$rows = records_query("clients", ["field" => "status", "op" => "=", "value" => "Ready"](/help/field-status-op-value-ready));
foreach ( $rows as $row ) {
portal_send_link(7, $row);
}
Example output
"jane@acme.example"
Notes
- There is no way to get the link itself into an automation, on purpose. Anything an automation holds can end up in its run log, and a sign-in link in the log is a way in for anyone who reads it.
- Each call replaces that person's previous link, which stops working.
- Throws if sign-in links are off, the portal is not published, its sign-in table is outside this automation's workspace scope, the record has no email address, or the email cannot be sent. Portal email limits apply, as for portal_send_login().