How do I trigger a email in Magento when an order is made? - email

I need solution for the following:
1) Customer places order
2) Store owner recieves email WITHOUT price info (e.g. packing list)
What files do I need to edit (I've read lots of posts and they don't seem to mention the file paths).
Thx

Two possible ways to achieve that:
You can create a model rewrite for the class Mage_Sales_Model_Order and override the function Mage_Sales_Model_Order::sendNewOrderEmail by sending an email to the shop owner using a different template
You can set the configuration entry "Sales Email/Order/Send Order Email Copy To" to nothing (so that the shop owner doesn't get the same email as the customer), and implement an observer catching the event sales_order_place_after. In the observer function you implement sending of an email to the shop owner using a template without the price info.

I know I had a hack for it ... and then I don't have it anymore. I went through everything I could and right now, we're CCing ourselves the customer notification email. As soon as we're done with our site upgrade, I'll have to readd my hack. I'm pretty sure it's in app/core/Mage/Sales/Model/Order.php possibly in public function sendNewOrderEmail()
See this pic:
I remember hard coding in a file after the customer notification was sent, we sent another one to admin but hard coding the template ID for the transactional order notification email to 8. Now, somehow, I'm doing it the "right way" but have no idea how I'm triggering this transactional email to ALSO happen with the customer order notification.

Make your custom module in that module just send a event after "sales_order_save_after".
Catch this event in observer file and put your custum coding on observer.
Read this

Related

Sending Emails from different accounts with Google App Script

I have generated the codes with app script in order to send emails automatically if users changed some values in google spreadsheet, which is working fine.
Now I am sharing my google spreadsheet with the app script to two more person (e.g: PersonA, PersonB). Thus, I want whoever changes anything on google spreadsheet will be sending an email under his/her own account. E.g: [All of us needs to edit within the google spreadsheet itself, without going to the "current web app url", (thanks Cameron Roberts for the clarification] if PersonA changes anything, then an email will be sent out under PersonA's account, and an email will be sent out under PersonB's account if PersonB changes anything.
I did something based on the advice from user2970721 and Cameron Roberts. I adjusted "Deploy web App" as "User accessing the web app". e.g:
I also asked PersonA & PersonB to do the same under their accounts and made sure they have triggered the script at least once. e.g:
My issue is that after I have done all these mentioned above, no matter who changes anything on google spreadsheet, emails were always sent out from PersonB's account (my best guess is that I messed up something and PersonB was the last one who triggered the script).
Does the "Project version" need to be different for me, PersonA, and PersonB, or anything else I need to change? Any help would be greatly appreciated!
First, Your project versions do not need to be different for each user.
I'm assuming you are using the On Change event, rather than a web-app. If that's the case, you should disable the WebApp entirely, as it's not needed.
When PersonA creates an On Change trigger, that will be triggered anytime any user (eg PersonA or PersonB) edits the spreadsheet. When it is triggered the code will execute as PersonA , because PersonA created the trigger. As a result, the email will be sent from PersonA's account.
For the scenario you describe, where both PersonA and PersonB have created OnChange triggers and authorised the script. I would expect emails to be sent from both accounts that have created triggers.
To send only one email, from the account that did the edit, I think you would need to do a check to determine if the user who did the edit matches the user under who's authority the script is running. I've never done this before and the docs don't really make it clear if it's possible.
Try checking the User object (Eg e.user) included with the Change event, and see if that email address is reflecting the different users making the edits.
If it is, you can compare it with the effective user and send the email if they match.
https://developers.google.com/apps-script/reference/base/user
https://developers.google.com/apps-script/reference/base/session#getEffectiveUser()
Finally, it might be simpler to just include the address of the person making the edit in your email subject, and just have all the emails send from one account. That way you know who made the edit, but don't need to have every user create a trigger and do all the extra checking.

Netsuite Show Purchase Order in Email Template

I am trying to show the customer's purchase order number in the order-fulfilled email template. It's my own template design with the standard tags that netsuite provides.
I sent them a ticket asking if they have a tag like that, and apparently they do not. They said that feature in unavailable.
Is there a way that I can put a code into the email template that when the customer reads their email, they can view their purchase order number?
that's our customer's #1 question in regards to all the calls that we get is what their purchase order is. This can definitely help us out. I'm new to netsuite so I still do not know how to code around it or create a new tag.
Should work - This is the Live version we use. Like they said, NLTRANID...but that is our PO reference for them which is our internal number...your client likely wants their clients' Reference PO numbers for b2b transaction transparency.
To:
<NLBILLADDRESS>
We are sending you the Purchase Order No <NLTRANID> as PDF attachment
Try this one too: <NLOTHERREFNUM>

Send order confirmation emails in custom module of Magento

I have created a custom module in Magento which performs the whole process starting from selecting a product, registering the customer and checking out with that product. The code for the entire process is done through code in indexcontroller of this module. Everything is done alright but the email is not sent on new order placed. I thought Magento would automatically send emails on new order creation even if the process is done programmatically. But it doesn't. Can anyone tell me how can I hook into the default sales order emails and send mails when the order is placed through custom module?
I have been able to sent mail to the new customer getting creating from this line of code just after saving the customer:
$customer->sendNewAccountEmail();
Does anyone know if there is some code like this to send new order email as well? Any help is much appreciated.
Try this. You need to use the methods through the object of your order:
$order->getSendConfirmation(null);
$order->sendNewOrderEmail();

which event is trigger,when a mail is sent by magento store?

I want to store all emails information,which is sent by magento store.For this i want to trigger a event,after a email is sent by magento store.there are lot of such action is there like when a email is send to user like forget password,registration,newsletter subscribe,wishlist share etc.
There is one idea in my mind that if there is such event is exist in magento like email_send_after,i can add my custum coding in observer file and get that event is trigger or not.but i don't know is there any event or not?
you might be interested in this but you can always configure the store email section as described here Also check out this blog post - v helpful

Add email recipient to all new Trac tickets

Is there a configuration change that can be made to Trac to send a notification to an email address only upon the creation of all new tickets? If it can't be done through config, a plugin would be the second best option, with source code modification as a last resort.
NOTE: The setting smtp_always_cc in the notification section of TracIni will send messages on all updates. I'm in need of email notifications only on the creation of a new ticket.
Does this have to be an email notification? One option you have is to create a query that will list the ten (or however many) most recently-created tickets. When looking at the results of the query, use the "RSS Feed" button at the bottom of the page to subscribe to a feed that will notify you whenever the results of that query get updated.
You could write your own ticket listener plugin (or rather, override the default one and tweak it), or write a email filter (procmail?) to remove non-creation mails.
The smtp_always_cc configuration option in trac.ini will do exactly that.
The one caveat is that it will also send an email on any updates to that issue -- not only on issue creation. This may or may not be what you want. See the TracNotification page in the help wiki for more information.
We use this feature in our product at Akiri Solutions.