How to Add Followers Into The Recipient Field of an Email in Odoo? - email

I'm currently using Odoo 12.0+e-20181025 and I'm trying to add the followers of each ticket made in helpdesk into an automated email whenever it has been changed (not only in stage). So far I've tried some codes and managed to put the followers' emails into the body of the text, but in the recipient field.
Here is the code I used:
% for follower in object.message_follower_ids:${follower.email_formatted}%endfor
I can use it in the body text but I can't produce any result in the Email To field. Any help is greatly appreciated.

You could use ${str(object.message_partner_ids.ids).replace('[', '').replace(']', '')} in "To (Partners)" field.

Related

Fetch Email with Mailkit order by Date - need faster way

I need to fetch emails in batches from a mail box which has been through several migrations.
There was an email provider before, then the mail box was migrated to gmail and then to O365.
When I try to use UID, the emails are not fetched in reverse date order.
like this: IMailFolderObject.Fetch(startingUID, EndUID, MessageSummaryItemsObject);
To get emails in reverse date order through Mailkit, I tried to following.
var list = IMailFolderObject.Fetch(0, -1, MessageSummaryItems.Envelope | MessageSummaryItems.UniqueId).ToList();
list.Sort(new OrderBy[] { OrderBy.Date });
The emails are fetched but it takes a real long time to complete the job. Since the mailbox is really large.
I do not want to retrieve all the emails and sort them in my program.
Is there a way to get top 50 emails (sorted by date descending since I can not guarantee the UID order is not matching the order of date descending)
and the rest in batches of 50 in subsequent calls ?
Thanks for help in advance.
This is my first question so please let me know should there be more information.

Generate email once order is changed to filled in netsuite

Once someone clicks on the fulfill button on the Sales Order I want it to send an email to someone.How can make this occur in Netsuite?
You can create a custom workflow on sales order and configure the worflow to send email to the specific email id. The email id can be either custom one / a field value from the sales order record (ex. customer, salesperson etc.,)
The condition for the workflow will be
OldRecord.Status!="Pending Fulfillment" && NewRecord.Status!="Pending Fulfillment"
Thanks
Frederick D
you can write a user event on Item Fulfillment record type and send email using nlapiSendEmail()
You may want to put a check in script if type == 'create' to avoid sending email on other record operation.

SugarCRM related Field

I have sugarCRM 6.5.20 OnDemand. I am in the Studio. I have a 1:1 relationship from Leads to Leads. I am trying to get the Primary Email address of the related Lead and display it in a calculated field.
It seems like the calculated field formula should look like:
related($emails,"email1")
When I do that I get the following error:
Invalid formula: related: Unknown Field : email1
The dropdown list doesn't list the email at all. How can I get the email? All of my web searches have proven ineffective.
Update:
I am willing to make the calculated field be the primary email address of the current lead. To do that I found 2 variables named $email_addresses and $email_addresses_primary and $emails. There is also a function called valueAt.
I tried to use valueAt(1,$emails) and valueAt(1,$email_addresses)
The validator accepted the syntax but the value was always empty.
Can I make a calculated field off of the leads primary email?
You won't get the Email field for the Studio's formula calculation. Email field is stored in a separate table and not in the module's table. It is just put in the Layout along with the other fields of the module, but it is not the same as other fields. All the Email Addresses irrespective of the modules are stored together in the email_addresses table and are related to respective module records in the email_addr_bean_rel.

Is there any Key or name field (in Message.Header or else) SAME or RELATE for both received and sent mail?

Is there any Key or name field (in Message.Header or else) SAME or RELATE for both received and sent mail .
For example, MessageId is unique key for each message. But I want something else (Key).
I had not found any field in Message.Header(Message or MimeMessage or with also MimeMessageHelper)
I am using Java.Mail and I want to group each received and reply mail with a key.
Anybody help me, Please ?
In a word.
No.
There is nothing in the headers to tie one email to another. The closest you can do, is compare subjects + the Date.

Create Email with a workflow in MS Dynamics Crm 2011 and dynamically fill the "To" field

I'm working on Ms Dynamics Crm 2011 development and I encountered following problem.
My situation:
I want to be able to automatically send an Email after a change on a specific status field on a record of the Entity "MyEntity". "MyEntity" has an Email-field. I try to create a workflow which sends an Email to the Email-field address of the "MyEntity" record after the status has been changed. My problem is that I can't add in the Email Creation workflow to the "To" field this "MyEntity" Email-field adress. I need to somehow specify in the workflow to dynamically add the "To" field, the relating Email address from the specific "MyEntity". Is that possible? Is there a workaround for that? It could be done with a plugin I guess, but by now I'm trying to avoid the plugin solution.
Thanks in advance
John
Yes, you should be able to. First go to Solutions, bring up your entity, go to Fields, bring up your e-mail field and ensure the Format is e-mail. Publish.
Work around: If you have more than 1 e-mail Format text field, change the others temporarily (to text from e-mail) and Publish. Otherwise, the next step is ambiguous and we don't have control over which field CRM sets up as the email to use when this entity is used for e-mail.
In the solution frame, select your entity node in the tree. Under Communication and Collaboration, check the box 'Sending e-mail (If an e-mail field does not exist, one will be created).' Save/Publish.
Fix the work around above if you had more than 1 e-mail format text field. Change them back to e-mail. Publish.
In Workflow, select your To Field. Under the Send e-mail step, select 'Set Properties.' Select the 'To' field. In the form assistant you should not be able to select your entity. NOTE: You will bind to the 'Key' field and NOT to the particular e-mail field.
This only works for a single e-mail field on your custom entity. There is no way to use a text field as an address in a CRM 'to' field.
Unfortunately you cannot.
Out of the box the To field in an email accepts only
Account
Contact
Facility/Equipment
Lead
Queue
User
So in order to achieve the goal , you will have to write a custom workflow activity (optional : taking the custom text field in your input parameter )and refer it in your workflow or develop a plug-in.
Sample code for Plugin:
SendEmailRequest req = new SendEmailRequest();
req.EmailId = emailId;//ID of created mail
req.TrackingToken = "";
req.IssueSend = true;
For more information check this post Crm 2011 :Workflow - Sending email problem