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
teknicsandteknicsand 

Sending automated emails to external users using S-Controls??

Hi,

The problem I'm faced with is as described below.

In the opportunity tab, when the stage field is changed from one stage to another, for example, from Negotiating to Closed/Won, the workflow is setup to send out emails to the Salesforce users from an email template automatically. But the workflow, to the best of my knowledge, does not allow an email to be also sent out to an external user, the customer in this case.

Can S-Controls be used to solve this issue? If so can anyone point me in some direction. I've been reading on how to send emails using the Email API and S-controls, but I don't seem to understand how a contact s email address associated with the opportunity that is being currently viewed can be extracted and then used to fire out an automatic email when the field stages are changed.

If anyone has any ideas, please let me know. I would greatly appreciate it.

Thanks.

-Sand
werewolfwerewolf
Workflow Email Alerts can send to external addresses if those addresses are related contacts.  You can also hardcode up to 5 external addresses in the "additional addresses" list of the Email Alert. First, though, drop down the box next to Recipients and see what Related Contacts are available to send emails to -- that will probably be easiest.
teknicsandteknicsand
The related contact drop down selection does not yield any values to choose from.  The email addresses are hard coded to be sent to members of our team, but we also need to send out emails to our customers automatically when opportunity stage is closed won. Is there a way to achieve it using s-controls given that workflow may not solve our problem?

-sand


Message Edited by teknicsand on 11-10-2008 11:05 AM
werewolfwerewolf
Well, by default opportunity does not have a lookup to Contact -- it has the Opportunity Contact Roles table, which can have many contacts.  Is your goal to send an email to just one contact or to many?  If it's just one then you could create a lookup on Opportunity to Contact, which would enable that Related Contacts area in Workflow.  If it's many then you'll want to query the Opportunity Contact Roles associated with the present Opportunity and pass them off to sendEmail.
teknicsandteknicsand
Well, unfortunately we don't use the Opportunity contact roles table right now. So the Opportunity contact roles won't be of much help to query.
When the lead in our system is converted, it converts to opportunity, account and a contact. So is there a way to query the contact associated with the opportunity by using the accountId. I'm guessing the accountId should be able to identify the account, opportunity and the contact.

-sand
werewolfwerewolf
Actually, when you convert a lead, the contact automatically goes in its Opportunity Contact Roles table, even if you're not showing it on the layout.  So you'll still want to query on that, I think.
teknicsandteknicsand
The query does not pull up any results if the contact role is not selected. If I click on new in the contact role section of opportunity tab, and select one of the contacts, only then does the query pull up information. The OpportunityContactRole seems to have information, because when a new contact role is created there are values to choose from, but the query cannot pull up information without the contact role being created.

-sandeep