Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created a SharePoint State Machine workflow in Visual Studio 2010 and all works fine and all emails are sent out correctly. I would like to change the content of the email that is sent out (i.e custom subject, email body, etc.) Is this possible in VS2010? I know you can do this in SPD workflow by manipulating properties, but can this be done the same in Visual Studio? Is their a way to import the solution package in to SPD to be changed?

Would I be able to use the createTask option in my stateInitialization Activity as well as the onTaskChanged eventDriven Activity to make this happen?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

For workflow Task Email you can only change the email body and the subject line must stay the same. To change the email body do the following

Just do like this within your MethodInvoking statement for the state you are sending out a custom email

this.myTaskProperties.EmailBody = "define your custom message body here. You can write html"; 
this.myTaskProperties.SendEmailNotification = true; 
share|improve this answer
add comment
this.myTaskProperties.EmailBody = "Define your custom message body here. You can write html";
this.myTaskProperties.SendEmailNotification = true; 
this.myTaskProperties.HasCustomEmailBody = true;

The above worked for me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.