Class NotifyClient
Implements notification operations like sending an email or a Microsoft Teams message.
note
These notifications will be sent from the devbot@neonforge.com user because that user doesn't enable multi-factor authentication (MFA) whereas our developer Office accounts do enable MFA. MFA prevents basic authentication from working.
Namespace: Neon.Deployment
Assembly: Neon.Deployment.dll
Syntax
public class NotifyClient
Constructors
NotifyClient(string, string)
Constructor.
Declaration
public NotifyClient(string username = null, string password = null)
Parameters
Type | Name | Description |
---|---|---|
string | username | Optionally specifies the Office 365 username (like: "sally@neonforge.com"). |
string | password | Optionally specifies the password. |
Remarks
This constructor obtains these values from neon-assistant from the devbot@neonforge.com user's NEONFORGE_LOGIN secret when not specified explicitly.
Methods
SendMail(string, string, string, bool, string, string, IEnumerable<string>)
Sends an email via the devbot@neonforge.com Office 356 account.
Declaration
public void SendMail(string to, string subject, string body = null, bool bodyAsHtml = false, string cc = null, string bcc = null, IEnumerable<string> attachmentPaths = null)
Parameters
Type | Name | Description |
---|---|---|
string | to | Specifies the target email addresses separated with commas. |
string | subject | Specifies the subject line. |
string | body | Optionally specifies the message body text. |
bool | bodyAsHtml | Optionally indicates that the body text is HTML. |
string | cc | Optionally specifies the target CC (carbon copy) addresses separated with commas. |
string | bcc | Optionally specifies the target BCC (blind carbon copy) addresses separated with commas. |
IEnumerable<string> | attachmentPaths | Specifies the file paths to any attachments to be included. |
SendTeamsMessage(string, string)
Sends a message to a Office 365 Teams channel.
Declaration
public void SendTeamsMessage(string channelUri, string cardJson)
Parameters
Type | Name | Description |
---|---|---|
string | channelUri | Specifies the target Teams channel URI. |
string | cardJson | Specifies the message as the legancy MessageCard format:
https://learn.microsoft.com/en-us/outlook/actionable-messages/message-card-reference noteAdaptive Cards are not supported by the Teams Connector at this time. |