Builds the state the Python SDK's email_state() builds: subject, a
cleaned body, from when a sender is given, then any extra fields. Pass
the result to laya_predict(), or use it with the "email" preset
(laya_preset()).
Arguments
- subject, body
The email's subject and body, single strings.
- sender
Optional sender address, stored in the state's
fromfield.- ...
Extra named fields to add to the state (for example
ticket_id = 4411).NULLfields are dropped, as in Python.- clean
Clean the body with
laya_clean_email()? IfFALSEthe body is passed through whole.- max_chars
Passed to
laya_clean_email()whenclean = TRUE.
Examples
laya_email_state(
subject = "Duplicate charge",
body = "We were billed twice.\n\n-- \nAna Muller\nAcme Corp",
sender = "ana@example.com",
ticket_id = 4411L
)
#> $subject
#> [1] "Duplicate charge"
#>
#> $body
#> [1] "We were billed twice."
#>
#> $from
#> [1] "ana@example.com"
#>
#> $ticket_id
#> [1] 4411
#>