Exemple #1
0
        public async Task ProductAssigned(Guid accountId, ViewOwnerProduct product, Account targetUser)
        {
            if (object.Equals(targetUser, null) || targetUser.Id == accountId)
            {
                return;
            }

            var ownerUser = await _auth.AccountGetAsync(accountId);

            var targetUserNotification = await CreateNotification(targetUser);

            var ownerUserNotification = await CreateNotification(ownerUser);

            var notification = new ProductAssignedNotification(targetUserNotification, product.ProductName, ownerUserNotification);

            if (targetUser.IsEmptyPassword())
            {
                var uri = await _auth.GeneratePasswordResetTokenLinkAsync(targetUser, _settings.CreatePassword);

                notification.CreatePasswordLink = uri.ToString();
            }

            if (product.IsPPC)
            {
                await _repository.SendProductEditionAssignedNotification(notification);
            }
            else
            {
                await _repository.SendProductAssignedNotification(notification);
            }
        }
Exemple #2
0
 internal static void ProductAssignedCreatePassword(string language, Notification notification, string product)
 {
     notification = new ProductAssignedNotification(notification, product, notification)
     {
         DownloadLink = "https://sodapdf.com/"
     };
     Send(language, EmailTemplate.ProductAssignedNotificationCreatePassword, notification);
 }
        public async Task SendProductEditionAssignedNotification(ProductAssignedNotification model)
        {
            var emailTemplate = EmailTemplate.ProductEditionAssignedNotification;

            if (!string.IsNullOrEmpty(model.CreatePasswordLink))
            {
                emailTemplate = EmailTemplate.ProductEditionAssignedNotificationCreatePassword;
            }

            await EmailInsert(model.AccountId, emailTemplate, model.Email, model);
        }
Exemple #4
0
        public async Task ProductUnassigned(Guid accountId, ViewOwnerProduct product, Account targetUser)
        {
            if (object.Equals(targetUser, null) || targetUser.Id == accountId)
            {
                return;
            }

            var ownerUser = await _auth.AccountGetAsync(accountId);

            var targetUserNotification = await CreateNotification(targetUser);

            var ownerUserNotification = await CreateNotification(ownerUser);

            var notification = new ProductAssignedNotification(targetUserNotification, product.ProductName, ownerUserNotification);

            await _repository.SendProductUnassignedNotification(notification);
        }
Exemple #5
0
 internal static void ProductUnassigned(string language, Notification notification, string product)
 {
     notification = new ProductAssignedNotification(notification, product, notification);
     Send(language, EmailTemplate.ProductUnassignedNotification, notification);
 }
 public async Task SendProductUnassignedNotification(ProductAssignedNotification model)
 {
     await EmailInsert(model.AccountId, EmailTemplate.ProductUnassignedNotification, model.Email, model);
 }