Open Closed

background job #5154


User avatar
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:"
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

11 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    What is the name?

    Can you share some code?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Zahra created

    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
                                    }
                                );
                                ```
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I think the code is no problem, I don't understand it very well. How to reproduce?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Zahra created

    if I invent some peoples for a meetings ..it will send an email for all of them

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Zahra created

    maybe their is configuration I forget to write

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I still don't know your problem.

    Can you explain in more detail?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Zahra created

    background job dose not work ...I don't know why

    I send for you the code and this is the error

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Ok, I see.

    Please share the error/exception info next time.

    I will check this.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share a minimal project to reproduce the problem?

    liming.ma@volosoft.com

    Thanks

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Zahra created

    I can not send my project because it is private

    I think you can solve it without my project

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can test your code in a new template project.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.