Find your content:

Search form

You are here

how to send an email from an Opportunity, with a snapshot of the Opportunity

 
Share

how to send an email from an Opportunity, with a snapshot of the Opportunity. I have 5 opportunity record types.


Attribution to: satya21224

Possible Suggestion/Solution #1

You could just do this with almost all standard functionality.

If the email needs to be send out on the push of a button, you could create a custom button on the detail page that sets a checkbox to true 'SendEmail'. the custom button can be onClick Javascript.

 {!REQUIRESCRIPT("/soap/ajax/27.0/connection.js")}

var newRecords = []; 

var o = new sforce.SObject("Opportunity"); 
o.id = "{!Opportunity.Id}"; 
o.SendEmail__c = true; 

newRecords.push(o); 
result = sforce.connection.update(newRecords); 

Then you create a workflow that checks on this SendEmail__c checkbox and if it is true then as action you send out the email, as a second action (field update) you put this checkbox again to false.

There are still a lot of possibilities, but this will already help you in thinking how this could be solved.


Attribution to: Sven Delporte

Possible Suggestion/Solution #2

Yes you can achieve this by below steps

step 1) Create a button on standard button and button Behavior should be Execute JavaScript.

A) In this button you have to write javascript and remember include below files

1) {!REQUIRESCRIPT("/soap/ajax/16.0/connection.js")} 
2) {!REQUIRESCRIPT("/soap/ajax/16.0/apex.js")} 

step 2) You have to write a globle class in which you have to define a webservice method. Call this webservice method from button. When you call this method pass the opportunity id as a parameter and you can write the code in your method for email sending.

Now you need info, how we can call a method from javascript, so below links help you http://www.infallibletechie.com/2012/10/calling-apex-method-from-custom-buttom.html http://salesforcesource.blogspot.in/2009/06/triggering-apex-method-with-custom.html http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_email_outbound_single.htm


Attribution to: D-Horse
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/30861

My Block Status

My Block Content