function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
galigali 

sending emails from scontrols

Hello. What are my options for sending emails from an scontrol? My thought is to write a standalone process that combs through objects and sends the appropriate emails, but I thought I'd check the scontrol route as well.
thanks
Ron HessRon Hess
We did the scontrol route for building and sending an email which was a bit more complex that can be done with normal templates

the scontrol queries some partner accounts and custom objects attached to the opportunity , then constructs a URL to open the "emailauthor.jsp" window which then is one click from sending. All the fields: to, what, cc are filled in by the scontrol (AJAX) and finaly the user who clicked on the scontrol can click Send.

so, it's a 2 click solution using Scontrol and AJAX.
Ron HessRon Hess
Here is the presentation link with some src for the tips and tricks ,

http://www.crmsuccess.com/browse/content_detail.jsp?id=006300000034wTZAAY

i think the email tip is outlined in there.
MelliottMelliott
Hi Ron,

I don't see the email s-control in the top 10. Am I missing it. I hope it will help me. I need a basis and can go from there. I am not a true developer and need the base code to start and then I dabble enough to be very scary and somewhat effective.

I need to be able to have a s-control send an email automatically when new record is created, if that records meets a certain criteria. Sounds like a work alert right...Not. I need it to email a field that is not the canned email field. I have a seperate field that contains an email address (it changes with each record) and need to have it email that field. I figure I can have the email go to the owner of the lead and have that other email field put into the additional to section. Do you have code for auto sending an email once it is created. I can change between lead and opps. I'm not sure which I want it on currently, probably lead though.
DevAngelDevAngel

I found a good explanation about sending email from javascript. This is pretty common sense, but it sounds like it is worth posting: http://www.javascript-coder.com/javascript-form/javascript-email-form.phtml

Excerpt:

Can JavaScript email a form?

NO! JavaScript can't email a form! but, there are alternatives to send the form data to an email address.

There is no direct method provided by JavaScript to send the data submitted in the form to an email address.

The main concern for not providing a 'JavaScript email form' feature is security.
Suppose there is a feature in JavaScript to send email. Some malicious coder can write a script to send email to some address immediately when you visit their page. This will reveal your email address to some third party without your knowledge. They will start filling your mail box with lots of spam messages!

However, there are alternatives as explained below.

Using 'mailto:'

You can use 'mailto:me@mydomain.com' in the action field of the form. When the user presses the submit button of the form, the browser will first show a warning box that the user's email address will be revealed to the recipient.

The_FoxThe_Fox
Hello,

Concerning emails in Salesforce, what you can do is your own form and in your form have the same id/name for the fields that salesforce email form page and post your form to .../emailauthor.jsp or something like that.

That What I have done and that works correctly. I have done that before email was available for custom objects and to limit what my users can do ie sure they won't send the mail of the custom objects to customers

Regards
QasQas
Fox,
 
Is there anyway you could provide some more details on this. I am trying to achieve something similar.
 
Here is a link to what I want to achieve.
 
Cheers
 
Qas
The_FoxThe_Fox
Hi Qas

You could email me at chumbert at odyssey-group dot com

Regards
QasQas
Thanks for getting back to me on this Fox. I sent you a message at the address you provided. Will wait for your reply.
 
Qas
sbasba
Could you please let me know, how you have got this problem solved.?