private async Task SendMailGebrauchskopieOk(ConsumeContext <IAssetReady> context) { try { var template = parameterHelper.GetSetting <GebrauchskopieZumDownloadBereit>(); var message = context.Message; var dataContext = dataBuilder .AddVe(message.ArchiveRecordId) .AddUser(message.Recipient) .AddValue("PasswortZipDatei", passwordHelper.GetHashPassword(message.ArchiveRecordId)) .AddValue("IstGebrauchskopieÖffentlich", message.RetentionCategory == CacheRetentionCategory.UsageCopyPublic) .AddValue("IstGebrauchskopieEb", message.RetentionCategory == CacheRetentionCategory.UsageCopyEB) .AddValue("IstGebrauchskopieAb", message.RetentionCategory == CacheRetentionCategory.UsageCopyAB) .AddValue("IstGebrauchskopieBarOderAs", message.RetentionCategory == CacheRetentionCategory.UsageCopyBarOrAS) .Create(); await mailHelper.SendEmail(bus, template, dataContext); } catch (Exception ex) { Log.Error(ex, "An exception occurred while sending an EMail"); throw; } }
private async Task SendPasswordEmailGebrauchskopie(ConsumeContext <DownloadAssetRequest> context) { try { var manager = parameterHelper.GetSetting <GebrauchskopiePasswort>(); var message = context.Message; var dataContext = dataBuilder .AddVe(message.ArchiveRecordId) .AddUser(message.Recipient) .AddValue("PasswortZipDatei", passwordHelper.GetHashPassword(message.ArchiveRecordId)) .AddValue("IstGebrauchskopieMitEinsichtsbewilligung", message.RetentionCategory == CacheRetentionCategory.UsageCopyEB) .Create(); await mailHelper.SendEmail(bus, manager, dataContext); } catch (Exception ex) { Log.Error(ex, "An exception occurred while sending an EMail"); throw; } }