I have a class which has a method to send an email with the record details attached to it. But for some reason I am not getting the email. Here is the VF and controller that I use(just the code in scope):
VF page I have:
<apex:commandButton action="{!sendEmail}" value="Send an email"/>
Extension I have:
public void sendEmail () {
OutboundEmails.SendEmailNotification(customobject.id); //customobject value I get it using getrecord() in extension's constructor.
}
The OutboundEmails looks like:
global class OutboundEmails {
WebService static void SendEmailNotification(string id) {
.....
....
send and email // works fine because I test it by creating a custom button and calling this function from there.
}
}
What am I missing here?