I have this:
.SentOnBehalfOfName = """Customer Service"" <customerservice#testing.test>"
the name "Customer Service" is officially associated with the email address. I'd like to change that display name to something else but keep using the same email address like this:
.SentOnBehalfOfName = """ABC Event CS"" <customerservice#testing.test>"
or
.SentOnBehalfOfName = """XYZ Event CS"" <customerservice#testing.test>"
But it always uses the default display name instead of the one I specify. Is it possible to achieve this in some way?
Exchange always uses the default name and the primary SMTP address when sending. If you want to change the display name and/or select one of the proxy addresses from a particular mailbox, sending through SMTP is the only option if you need to do that programmatically. In case of an end user, you can use a product like Proxy Manager (I am its author).
Related
I need to trigger two emails for my application, one to logged-in user and one to customer-care.
For the customer care, I am setting the email id in project.properties and then hitting the event class:
deleteAccountSupportEvent.setAgentEmail(agentEmailAddress);
agentEmailAddress is picking email id from project.properties:
final String agentEmailAddress = getConfigurationService().getConfiguration().getString(DELETE_REQUEST_EMAIL_TO_AGENT);
I have set the email in Context class as well :
setAgentEmail(((PHDeleteAccountEmailProcessModel) processModel).getAgentEmail());
But instead of all this, mail is getting triggered to logged-in user.
Please help.
You can keep it simple as follows:
final String agentEmailAddress = getConfigurationService().getConfiguration().getString(DELETE_REQUEST_EMAIL_TO_AGENT);
setAgentEmail(agentEmailAddress);
As far as I know context is used for mail body dynamic content. There might be logic where to email addresses are added.
I am logging into gmail via python and deleting emails. However when I do a search for two emails I get no results to delete.
mail.select('Inbox')
result,data = mail.uid('search',None '(FROM target.com)')
The above works and will find and delete any email that had target.com in the from address. However when I send in another email address I get nothing.
result,data = mail.uid('search',None '(FROM "target.com" FROM "walmart.com")')
Yes I have both target.com and walmart.com emails in my inbox.
Gmail search is exactly like Searching in the gmail website. If you open that and click the arrow down buttom in the search field you can test things.
That being said searching on more then one address is not going to work as its going to look for emails that are by both people. Not all emails containing one or the other.
The following will look for mails that both come from tom and jon. probably not possible as you cant have two senders
from:(tom#gmail.com,jon#comcast.net)
where as will return all mails that come from gmail.com
from:(gmail.com)
will only return mails sent from gmail.com and comcast.net which inst possible
from:(tom#gmail.com,comcast.net)
your going to have to make two requests.
You can search set this type of filter:
from:(demo#gmail.com OR demo1#yahoo.com)
I'm using a pre-operation plugin on create of email to change the entity reference on the email's "from" attribute.
This is the code I use for the setting:
((EntityCollection)entity.Attributes["from"]).Entities[0].Attributes["partyid"] = erQueue; //erQueue is an entityReference of a certain queue
I also want the email to be sent from the queue email adddress, and not from the original sender's address.
should I also set the "addressused attribue of the "from" activityparty, or would it happen automatically?
CRM should default the email address used to primary email address of the selected record.
I've only used addressused in the past when I wanted to use an email address other than the primary email address of the selected record.
So in your case I don't think you need to set the addressused.
Slightly old documentation but still true and relevant I believe.
activityparty.addressused Property
The property activityparty.partyid contains the ID of an account,
contact, lead or systemuser. For account, contact or lead, the
property emailaddress1 is used as the default value for the e-mail
address. If this value is blank, emailaddress2 is used, and so on. For
systemuser, the default e-mail address is internalemailaddress.
To override this default, you can specify an alternate address as the value for addressused. For example, if you set addressused to the
value "someone#example.com", that e-mail address will be used.
After I checked, the email was sent with the email address of the original system user in the "from" field. So I had to change the addressused of the activityparty in the from attribute:
((EntityCollection)entity.Attributes["from"]).Entities[0].Attributes["addressused"] = sQueueEmailAddress;
I would like to also change the field "sent by" (displaying when there is a mailDoc.Principal) in the mail being sent by a triggered agent created in lotus script. Is it possible to change it I already tried the following codes
mailDoc.SentBy = strFrom
mailDoc.tmpDisplaySentBy = strFrom
mailDoc.FROM = strFrom
mailDoc.SendFrom = strFrom
Still I couldn't change that part.. Is it possible or is there some limitation?.. Thanks
You can't change it. The server puts always the current username into field Principal/From.
But there is a workaround: instead of sending the mail save the mail document into mail.box on server with a Principal/From field content of your choice. This way server won't change the field anymore.
Here is an example from Karl-Henry Martinsson how to do it.
Let say I have a Contact Us form in Orchard CMS that I have created that had the following fields
Name:
Email Address:
Message:
Newsletter:
Now upon submitting this form I have it set to email a specific email address and I'm using the Tokens for the four fields to build the email so that the email received might look like this.
Name: John Smith
Email Address: jsmith#example.com
Message: Hi! I love your site and I hope you get some more content that I can use in the future!
Newsletter: True
Now this is fine, but the last field Newsletter is a boolean and I'd like the text represented here to be Yes/No (or potentially other custom words). How do I substitute the default True/False token values in the email for custom ones?
You'll probably need to implement your own token provider for this. Here is an example from the Orchard.Fields module... FieldTokens.cs
Note that there is no direct reference to the Orchard.Tokens project here so they use the event bus convention where you can define your own interface with the same name and signature as another event handler. Orchard will see this convention and treat your implementation as a handler for those events. I only mention this because it confused me at first. You can directly reference the tokens module if you want to.