public bool SendVerificationCode() { if (VerificationCode.IsEmpty() || VerificationCodeExpiry < DateTime.UtcNow) { VerificationCode = GeneratePIN(4); VerificationCodeExpiry = DateTime.UtcNow.AddDays(1); Save(); } var message = string.Format(Translations.Translate("Verification Code", LanguageId), VerificationCode); return(SMS.SendMessage(Telephone, message)); }
private void SendPushNotification(string DeviceARN) { var message = "Notification"; switch (TypeId) { case NotificationType.BookingCancelled: message = string.Format(Translations.Translate("Booking Cancelled", User.LanguageId), BookingId); break; case NotificationType.BookingConfirmed: message = string.Format(Translations.Translate("Booking Confirmed", User.LanguageId), BookingId); break; case NotificationType.NewBooking: message = string.Format(Translations.Translate("Booking Received", User.LanguageId), BookingId); break; case NotificationType.NewReview: message = string.Format(Translations.Translate("New Review", User.LanguageId), BookingId); break; case NotificationType.PaymentReceived: message = string.Format(Translations.Translate("Payment Received", User.LanguageId), BookingId); break; case NotificationType.ServiceComplete: message = string.Format(Translations.Translate("Booking Completed", User.LanguageId), BookingId); break; case NotificationType.ServiceIncomplete: message = string.Format(Translations.Translate("Booking Not Completed", User.LanguageId), BookingId); break; } var args = new Dictionary <string, object> { { "UserId", UserId }, { "BookingId", BookingId } }; SNS.SendMessage(DeviceARN, message, $"app.agrishare.category.{TypeId}", args); }
private void SendSMS() { var message = "Notification"; switch (TypeId) { case NotificationType.BookingCancelled: message = string.Format(Translations.Translate("Booking Cancelled", User.LanguageId), BookingId); break; case NotificationType.BookingConfirmed: message = string.Format(Translations.Translate("Booking Confirmed", User.LanguageId), BookingId); break; case NotificationType.NewBooking: message = string.Format(Translations.Translate("New Booking", User.LanguageId), BookingId); break; case NotificationType.NewReview: message = string.Format(Translations.Translate("New Review", User.LanguageId), BookingId); break; case NotificationType.PaymentReceived: message = string.Format(Translations.Translate("Payment Received", User.LanguageId), BookingId); break; case NotificationType.ServiceComplete: message = string.Format(Translations.Translate("Booking Completed", User.LanguageId), BookingId); break; case NotificationType.ServiceIncomplete: message = string.Format(Translations.Translate("Booking Not Completed", User.LanguageId), BookingId); break; } SMS.SendMessage(User.Telephone, message); }