The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
How to Trigger email when completing an Activity
Posted: 20 Mar 07 3:01 PM
|
fiogf49gjkf0d I was just asked if it would be possible to send an email to a contact when an activity is completed for an opportunity.
I'm pretty certain this is possible, but I am not so certain how it would be done. We are using 7.0.1 The requirements are
The trigger: Sned email when the result field of a completed activity is equal to "Completed Conference"
The following values have to be contained in the email.
Opportunity.Opportunityid Opportunity.History.Completeddate Opportunity.Opportunity Contact.Contact.Contact Name(Prefix First Last) Opportunity.History.Description
I would think this would be done completed activity save event. After everything is saved the custom code would check if the result field = "Completed Conference" and if it is call a custom routine that then sends an email.
Sending the email: How? I can only guess that a mail merge template can be used... but I am having an issue with the fields that are required to be in the mail merge template... They are coming from tables that I don't think are normally used in a mail merge template. Are they available?
The next email question... is how would you programmatically kick off the mail merge, tell it what mail merge template to use and how do you pass the correct contactid and special field values to the mail merge template?
Thanks in advance, John G. |
|
|
|
Re: How to Trigger email when completing an Activity
Posted: 20 Mar 07 3:28 PM
|
fiogf49gjkf0d Many ways to do this, since it is version 7 I'd probably opt to use a .NET Extension and make it an easy task using System.Web.Mail. However, scripting approaches would be easy as well.
Do you care if the user "sees" the email? If the new e-mail window popped open, already filled out (like how it does from the ticket area) is that OK? Or do you want it to be more behind the scenes?
If you don't care if the user sees the e-mail I would use the built-in QueMessage function (Application.BasicFunctions.QueMessage). It allows you to easily pass details into a new Outlook e-mail window. This would be extremely easy to add and would be an excellent choice - as long as you're OK with the user needing to click "Send".
If you wanted it to be seamless and behind the scenes, you could use CDO, see http://www.slxdeveloper.com/forum.aspx?forumid=2000&postid=2162#2162 There's more room for problems here, and you have to have an SMTP server available to handle the request. Using QueMessage you don't need to worry about that since you're just using their Outlook e-mail account. KWIM?
BTW, I wouldn't use a mail merge template for this, doesn't really sound like a good fit. |
|
|
|
Re: How to Trigger email when completing an Activity
Posted: 21 Mar 07 7:31 AM
|
fiogf49gjkf0d Ryan,
We don't want the user to see the email being sent. It just needs to 'happen' as I am being told. I guess this would point us to using the CDO method which introduces a few more issues. The one issue I am seeing is having an SMTP server available. I assume you mean an SMTP server on the client. This would mean additional configuration requirements for the workstation which will be harder to keep up as I've found these workstations can and have been rebuilt at any point in time.
I looked at the post you referred to and it looks pretty simple. Would the SMTP simply be our exchange server address? For example... ourexchangeservername.domain.com ?? OH, it also appears that CDO has to be installed as well.. I remember with Office 2003 the basic install removed the CDO from the installation. You had to explicitly tell it to install CDO. We all just upgraded to Office 2007 and I don't recall seeing the CDO at all in the installation? Any ideas if Office 2007 will be giving a problem?
I can present the idea of using QueMessage and having the user click Send. Seems like a good point to verify who the email is being sent to.
Thanks, John G.
|
|
|
|
Re: How to Trigger email when completing an Activity
Posted: 21 Mar 07 10:51 AM
|
fiogf49gjkf0d I'm looking to place the code to do this after the activity is completed and saved to history. I thought I'd find the save code in the plug-in (History)History Details View. Looks like I was wrong. There is no code to save the completed activity. There isn't even buttons on the form for the OK, Cancel and Help
Where do I find this?
Thanks, John G. |
|
|
|
Re: How to Trigger email when completing an Activity
Posted: 21 Mar 07 11:24 AM
|
fiogf49gjkf0d If you want it to be really seamless, since you're wanting to trigger the e-mail behind the scenes, you might want to consider doing this on the server instead.
You could have something on the server that looks for newly completed activities since the last time it checked, and then send the e-mail from there. That way, you won't ever have to troubleshoot problems on the workstations about why e-mail isn't sending, or why relaying is failing to the SMTP server from those workstations, or whether or not the workstation has the needed CDO files, etc. Just one place to worry about. If you say that it will be difficult to keep up the stuff on the workstations, then you're probably right. Moving this to a server makes it a lot more fool-proof.
Either way, you'll need an SMTP server. If your exchange box is visible you can just use the server name, or IP address. You'll need to make sure it allows relaying, or make sure you're authenticating for the SMTP connection. |
|
|
|
Re: How to Trigger email when completing an Activity
Posted: 21 Mar 07 11:50 AM
|
fiogf49gjkf0d I'm looking to place the code to do this after the activity is completed and saved to history. I thought I'd find the save code in the plug-in (History)History Details View. Looks like I was wrong. There is no code to save the completed activity. There isn't even buttons on the form for the OK, Cancel and Help
Where do I find this?
Thanks, John G. |
|
|
| |
| |
|
Re: How to Trigger email when completing an Activity
Posted: 21 Mar 07 3:43 PM
|
fiogf49gjkf0d In 6.x there used to be scripts called OnCompletedActivity that would be what you're looking for. I believe they were rolled into the Global Activity or other activity scripts from SLX. I couldn't tell you what you'd do once you found them, I only know that they are the key to doing any processing after an activity has been completed. These are scripts that are run on each client as an activity is processed, so as Ryan mentioned you could have problems specific to that machine that'll prevent emails from going through.
I think you have your products mixed up though because Scribe can't send emails to my knowledge. You're probably thinking of KnowledgeSync. If you have a KnowledgeSync license, that is usable. There's also TaskCentre, but I wouldn't spend ANY money on this given KS is expensive ($1500) for such a small use case and I could only guess TaskCentre is priced relatively the same. SQL Notification Services would do nicely since they're free and you're really only querying table data for your results.
The big thing here is deciding on how precise the emails need to be. Do the emails need to be sent immediately with no delays? Or could a script run once per hour, sending emails in batch. Then you get to determine how important the emails are. If all of them must go through, a server side process is rather necessity. If you're willing to bargain on the effectiveness of your clients and how they manage sending emails, then you can fall back on an in-client approach. |
|
|
| |
| |
|
Re: How to Trigger email when completing an Activity
Posted: 22 Mar 07 7:06 AM
|
fiogf49gjkf0d Jeremy,
I'll have to check, but I thought Scribe had the capability of sending emails. I looked at the KnowledgeSync info at http://www.saleslogix.com/home/index.php3?cellid=302045001011 and it reads pretty much the same as the Scribe info page http://www.scribesoft.com//products/integrate.asp In fact, they both talk about email. I'm checking with both products for their capabilities to do this. I think cost might be justified here because if what we have here (Scribe) can't do it and we don't own KS, the $1500 cost of KS would be relatively cheap considering the development cost involved to create something to do this from scratch. Also, the KS cost is lowered because if we went with KS we would not renew our Scribe support and maintenance.
Moving along. The emails do not have to be sent out immediately but the sooner the better. So a monitor of every hour or once a day to send emails in a batch would probably work. As for the in-client approach - this has to happen in the background with no interaction from the user. These emails are links to surveys being sent to clients about demos the user is doing for the client. We don't want the user to have any control over whether or not the email is sent. They might just choose not to send the email because the demo was a failure. Might just be me. Maybe this doesn't happen in the real world
John G. |
|
|
|
Re: How to Trigger email when completing an Activity
Posted: 22 Mar 07 8:16 AM
|
fiogf49gjkf0d The problem you are trying to solve is a great fit for TaskCentre. In fact it was developed to handle this type of situation. Just conatct a Partner that is certified in TaskCentre for a demo and I believe you will be amazed. -- rjl |
|
|
| |
|
Re: How to Trigger email when completing an Activity
Posted: 26 Mar 07 1:41 PM
|
fiogf49gjkf0d Ryan,
The custom app would probably be the best route to go I think. Seems like there'd be better control and more easily managed if there were new requirements later on. There would have to be a way to track which history already had an email sent. That should only be a matter of creating a table of historyids the process would populate as it sends emails.
If you want to post some code to get the basics going it would be well appreciated. I'll post a new thread for that.
Again, thanks for all the commentary and help!
John G. |
|
|
|
Re: How to Trigger email when completing an Activity
Posted: 27 Mar 07 3:29 AM
|
fiogf49gjkf0d Hi John,
We use KnowledgeSync with great success. I'd highly recommend it. The best bit is though you will solve this particular problem, it also introduces a vast number of other possibilities.
|
|
|
|
Re: How to Trigger email when completing an Activity
Posted: 04 Apr 07 12:19 PM
|
fiogf49gjkf0d Ryan is absolutely correct! KnowledgeSync typically automates the task for a "user frienldly" interface to the CDO and DTS functionality. I can tell you in every case that we have installed KnolwedgeSync, it has blossomed. I had one customer with the requirement for 1 query/event, there's now 70 running. The nice thing is that many events can fire from one simple query. Worth looking at. But if you're after the "value-add", keep developing them yourself! |
|
|
| |
|
Re: How to Trigger email when completing an Activity
Posted: 04 Apr 07 6:17 PM
|
fiogf49gjkf0d Hello, John:
I'm one of the "KnowledgeSync guys" and I just wanted to offer a demo of KnowledgeSync to you where I would show the event that does exactly what you have in mind. Or, if you prefer, you can download a free evaluation of KnowledgeSync and I can email you the pre-configured event which you can try out on your own. Just let me know -- and thanks for considering KnowledgeSync.
Regards,
Don Farber |
|
|
|
Re: How to Trigger email when completing an Activity
Posted: 05 Apr 07 6:20 AM
|
fiogf49gjkf0d Hi John, I'd also suggest you take a look at TaskCentre. I can arrange for you to get a full evaluation copy as well as support you thru your evaluation. I can arrange to provide you with several Work Flows/Alerts. In fact, I'll help you build a couple so that you can see how easy it is to do things in TaskCentre. -- rjl
|
|
|
|