magento: extra email recipients in order confirmation email - email

i have a peculiar problem, when customers receive an order confirmation email strangely this is also sent to some other older customers. I have searched file after file and do not know where this code is inserted, a previous developer inserted this and now very important i remove it. Which file is responsible to send out the new order confirmation email?

Check Your code on below location
app/code/core/Mage/Sales/Model/Order.php
Or(if file is override)
app/code/local/Mage/Sales/Model/Order.php
and find function around line no.1274
public function queueNewOrderEmail($forceMode = false)
and check $emailInfo->addTo($this->getCustomerEmail(), $customerName); function

Related

AppleScript code for copying new email subject

I'm setting up a rule in my Mail app to execute the AppleScript below when an email from a specific sender arrives. My goal is to copy the incoming email's subject line, however, this script is copying the subject of the currently selected email in the main inbox and not the arriving email's.
Is there a better way to achieve my goal?
tell application "Mail"
set _msgs to selected messages of message viewer 0
if (_msgs is not equal to missing value) then
set _msg to first item of _msgs
set the clipboard to (subject of _msg) as string
end if
end tell
You need to use the built-in handlers that Mail exposes to access the message associated with a rule activation; selected messages of message viewer 0 just accesses the active Mail window (as you describe). Instead, use Mail's on perform mail action handler to correctly access the message. See this question (and this answer) for more information.
Here is your code, re-written to correctly copy the subject line of incoming emails that satisfy the provided rule criteria. It's working for me on macOS Catalina 10.15.5:
using terms from application "Mail"
on perform mail action with messages _msgs for rule _rule
if (_msgs is not equal to missing value) then
set _msg to first item of _msgs
set the clipboard to (subject of _msg) as string
end if
end perform mail action with messages
end using terms from

change recipient / attach a file to a sent email in outlook

I've been trying to test something out, basically looking to do one of the following things:
Change name of recipient in a sent file. I've tried using Outlook Spy (great tool) but every time I changed the recipient in PR_DISPLAY_TO_W it returned the following error:
Could not edit the property: HrSetOneProp returned MAPL_E_COMPUTED
Attaching a file to a sent email file. (I don't know if this one is possible, but would be useful if it was.)
I appreciate any responses.
PR_DISPLAY_TO / CC / BCC are computed properties. The store provider updates them whenever recipients list is modified.
Use the MailItem.Recipients collection to modify the recipients.
MailItem.Attachments.Add.

Microsoft Outlook Message When Emailing in Progress Application

There is a below code, does not work
FOR EACH customer where customer.contactmethod = 'E':
MESSAGE "EMAILING TO" customer.customerCode customer.CustomerName.
RUN Emaling.p (INPUT parameter 1,INPUT pramater 2 ....)
END.
When this above loop executes it, it messages the first customer only. The reason I found is the outlook message.
The Outlook message is below
"A program is trying to send an email message on your behalf. if this is unexpected, clikc Deny and verify your antivirus software is upto date......................................."
if user click allow/deny in the outlook message, it does not message the second customer as it is stuck in first customer.
How can I suppress this outlook message using 4gl code?
The key to that is inside your "Emaling.p" procedure. Whatever technique that code is using to send email needs to be adjusted to bypass the security check.
Or you could disable whatever it is that is popping up that message. It looks like some over-zealous Windows security setting.
In any case it has nothing much to do with the 4gl code that you have shown.
Having said that -- your code is obviously incomplete and as shown would not be expected to work at all. Maybe it doesn't really look anything like that but a more workable version of the code above would be:
FOR EACH customer NO-LOCK where customer.contactmethod = 'E': /* without the NO-LOCK you might be aggravating a transaction scoping problem... */
MESSAGE "EMAILING TO" customer.customerCode customer.CustomerName.
do on error undo, leave: /* this may help to keep processing even if errors occur */
RUN Emaling.p (INPUT parameter 1,INPUT pramater 2 ....). /* you forgot the "." and knowing the rest of the parameters might help to suggest ways to get around the reported problem */
end.
END.

how to notice if a mail is a forwarded mail?

I have a very special problem.
If we create a mail in Outlook, we add a UserProperty which contains a DataBase-ID of our System, so we can Link the mail to the representing DataBase-Item. On the service which reads the mails in each Mailbox and imports them automatically I can read this property by using ExtendedPropertyDefinitions. So far everything is fine...
If the User now forwards the message in Outlook, Olk copies the UserProperty to the new message. And now my problems beginn. Now my Service thinks the new message is also linked to our database and updates DB-Entry with the new Body and new Subject.
So does anyone now how to find out if a message is a forwarded one or how to tell Outlook not to copy the userproperty to the forwarded (new) message?
thx. Jay
What we thought about, but isnt working for our case
- a second userproperty containing a simple tag linke "fromSystem". Cause this would be copied too.
- a second userproperty containing a hashsum calculated from subject and Body. Cause both could be changed by the user. We just create the message, add all properties and Display it. from this Point on we no longer have control what is Happening to the mail until the Service handles it.
Your service consuming EWS should check the ConversationIndex and only update the database if it's 22 bytes long (original source message). Forward emails and reply emails keep appending 5 bytes (10 chars) to the ConversationIndex extending it beyond 22 bytes.
Sample ConversationIndexes
Original: 01CDD15D80E51C1D4522172840ACA96287DA28A15D97
Reply: 01CDD15D80E51C1D4522172840ACA96287DA28A15D970000018630
Forward: 01CDD15D80E51C1D4522172840ACA96287DA28A15D970000018630000000FC30
ConversationIndex represents the sequential ordering of the ConversationTopic (essentially GUID + timestamp). See Working with Conversations on MSDN. ConversationIndex is explicitly defined on MSDN here.
if (message.ConversationIndex.Length == 22)
{
// update DB body, subject, etc.
}
Also make sure you load the EmailMessageSchema.ConversationIndex before trying to access its value.

Change the sender for an external email in SO_NEW_DOCUMENT_ATT_SEND_API1 function

I'm using SO_NEW_DOCUMENT_ATT_SEND_API1 function to send an email with an attachment both for a sap user and for an external email. So far, so good. I discovered that the sender of these emails is the sap user that fired the report and the function doesn't have the sender exportation parameter like the old SO_DOCUMENT_SEND_API1 has. The problem is that I need the sender to be an external email. I've been searching and couldn't make this happen. Can anyone help or give me an idea? Thanks
As I have already stated in an answer to another question of yours, stop using the old API and use the new BCS API. The documentation contains an example on how to change the sender address:
DATA: lr_send_request TYPE REF TO cl_bcs,
lr_sender TYPE REF TO cl_cam_address_bcs.
lr_sender = cl_cam_address_bcs=>create_internet_address( 'foo.bar#baz.com' ).
lr_send_request->set_sender( lr_sender ).
Just try to copy the example report BCS_EXAMPLE_1 to your local namespace and exchange the line that sets the sender (line 50 in my release, might be a different one on your system).