0
Zahra created
- ABP Framework version: v7
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): Separated server
- Exception message and stack trace: I am want to send email to list of users on background job >>>
- if i give a name for background job its work next time its not work until i change the name again
- so it need to change the name each time i want to send email
how i can use unique name for the email??
*
- Steps to reproduce the issue:"
11 Answer(s)
-
0
hi
What is the name?
Can you share some code?
-
0
on Application.Contracts Layers
[BackgroundJobName("EmailSendingArgs2")] public class EmailSendingArgs { public List<string>? EmailAddressList { get; set; } public string? Subject { get; set; } public string? Body { get; set; } }
on Application Layers
public class EmailSendingJob : AsyncBackgroundJob<EmailSendingArgs>, ITransientDependency { private readonly IEmailSender _emailSender; public EmailSendingJob(IEmailSender emailSender) { _emailSender = emailSender; } public override async Task ExecuteAsync(EmailSendingArgs args) { foreach (string emailAddress in args.EmailAddressList) { await _emailSender.SendAsync( emailAddress, args.Subject, args.Body ); } } }
on AppService
await _backgroundJobManager.EnqueueAsync( new EmailSendingArgs { EmailAddressList = emailAddressList, Subject = subject, Body = emailBody } ); ```
-
0
I think the code is no problem, I don't understand it very well. How to reproduce?
-
0
if I invent some peoples for a meetings ..it will send an email for all of them
-
0
maybe their is configuration I forget to write
-
0
hi
I still don't know your problem.
Can you explain in more detail?
-
0
-
0
Ok, I see.
Please share the error/exception info next time.
I will check this.
-
0
hi
Can you share a minimal project to reproduce the problem?
liming.ma@volosoft.com
Thanks
-
0
I can not send my project because it is private
I think you can solve it without my project
-
0
hi
You can test your code in a new template project.