You can call your email class in the finish method like this. If the method in the email service class is static then you call it like this.
public MyBatch implements Database.Batchable<SObject> {
...
public void finish(Database.BatchableContext context) {
EmailClass.sendEmail();
}
}
If the method in the emiail service class is non static then you call it like this
public MyBatch implements Database.Batchable<SObject> {
...
public void finish(Database.BatchableContext context) {
EmailClass c = new EmailClass();
c.sendEmail();
}
}
You can call your email class in the finish method like this. If the method in the email service class is static then you call it like this.
public MyBatch implements Database.Batchable<SObject> {
...
public void finish(Database.BatchableContext context) {
EmailClass.sendEmail();
}
}
If the method in the emiail service class is non static then you call it like this
public MyBatch implements Database.Batchable<SObject> {
...
public void finish(Database.BatchableContext context) {
EmailClass c = new EmailClass();
c.sendEmail();
}
}
You can call your email class in the finish method like this. If the method in the email service class is static then you call it like this.
If the method in the emiail service class is non static then you call it like this
Kindly mark it as an answer if that works !
All Answers
You can call your email class in the finish method like this. If the method in the email service class is static then you call it like this.
If the method in the emiail service class is non static then you call it like this
Kindly mark it as an answer if that works !
How can I refer BacthApex class in execute method of SheduleApex class?