Method ByContact
- Namespace
- MailFathom.Application.Mail.Delivery.Addressing
- Assembly
- MailFathom.Application.dll
ByContact(OutgoingRecipientRole, ContactId, string?)
Names a recipient by the identity the book gave them.
public static NamedRecipient ByContact(OutgoingRecipientRole role, ContactId contact, string? contactAddress = null)
Parameters
roleOutgoingRecipientRoleThe header to name them in.
contactContactIdThe contact to address.
contactAddressstringWhich of their addresses to use, or null for the one they prefer.
Returns
- NamedRecipient
The recipient the author named.
Exceptions
- ArgumentException
Thrown when
contactAddressis supplied blank.- ArgumentOutOfRangeException
Thrown when
roleis not a declared role.