Dynamicweb 8 Documentation
OnExtranetLogin Field
Example 

User extranet login notification. Occurs when the user successfully logged in
Syntax
'Declaration
 
Public Const OnExtranetLogin As String
public const string OnExtranetLogin
Example
Overriding the user extranet login notification in DynamicwebOverriding the user extranet login notification in Dynamicweb
namespace Dynamicweb.Examples.CSharp.Notifications.Standard
{
    [Dynamicweb.Extensibility.Subscribe(Dynamicweb.Notifications.Standard.User.OnExtranetLogin)]
    public class OnExtranetLoginObserver : Dynamicweb.Extensibility.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
        {
            if (args == null)
                return;

            if (!(args is Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs))
                return;

            Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs item = (Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs)args;
            //Pass user name to the notification e-mail
            string emailBody = string.Format("The user ({0}) has been logged-in.", item.User.Name);
            Dynamicweb.Modules.Common.Email.SendMail("user name", "username@somedomain.dk", "OnExtranetLoginObserver",
                "admin", "noreply@dynamicweb.dk", emailBody, "UTF-8");
        }
    }
}
Namespace Notifications.Standard
    <Extensibility.Subscribe(Global.Dynamicweb.Notifications.Standard.User.OnExtranetLogin)> _
    Public Class OnExtranetLoginObserver
        Inherits Global.Dynamicweb.Extensibility.NotificationSubscriber

        Public Overrides Sub OnNotify(ByVal notification As String, ByVal args As Global.Dynamicweb.Extensibility.NotificationArgs)
            If args Is Nothing Then
                Return
            End If

            If Not (TypeOf args Is Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs) Then
                Return
            End If

            Dim item As Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs = DirectCast(args, Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs)
            'Pass user name to the notification e-mail
            Dim emailBody As String = String.Format("The user ({0}) has been logged-in.", item.User.Name)
            Global.Dynamicweb.Modules.Common.Email.SendMail("user name", "username@somedomain.dk", "OnExtranetLoginObserver", "admin", "noreply@dynamicweb.dk", emailBody, "UTF-8")
        End Sub
    End Class
End Namespace
Remarks
The passed NotificationArgs is Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Standard.User Class
Standard.User Members

Send Feedback