How can I check if the order email is being sent to a specific email - magento-1.9

How can I check if the order email in magento 1.9 is being sent to a specific email and if it contains a specific text. If yes, I would like to add text to the email template. Is this possible?

Login Admin panel,
Go to system > Transactional Emails > Add new Template > Select New Order Template > Load Template.
After loading, you can get the template content. Also, you would be able to modify them and save.
Where to set : System > Configuration > Sales > Sales Emails > Order > New Order Confirmation Template > Here you can set you new template.
Also, insert your test email ID for testing in the field "Send Order Email Copy To".
Make an order and check the emails are getting sent or not.

Related

"Create or update" form behavior when hitting back button

I have the following workflow on a website:
Some user John Doe declares a company through form 1
(fields: name, head office location)
After John Doe submits (HTTP POST) form 1, he is redirected (HTTP 302) to company form 2 with additional legal information about the company.
The problem is, if John Doe hits the back button of his browser during step 2, he will land on the form 1, with data filled by the browser (using values he already submitted — that's what Firefox and major browsers seem to do).
John Doe might then think he can use this form to update some information (e.g. fix a typo in the name of the company) whereas he will actually create a new company doing so, as we don't know on the server side whether he wants to declare a new company or update the one he just created.
Do you know any simple solution to handle that problem ?
Use javascript/jquery script after the page is loaded to empty all the inputs. This will prevent confusion of "updating the company".
jQuery would look something like this:
$('#elementID').val('');
You can also handle the situation by manipulating the browser history
on load of form 2, and pass the CompanyId generated on submit of form 1 using querystring. So that you can actually update the company as the user
Suppose John submits form1.html, a unique CompanyId "1001" is generated and redirected to form2.html. Now on load of form2 you can modify the browser history form1.html?companyid=1001 using
var stateObj = { foo: "bar" };
history.pushState(stateObj, "page 1", "form1.html?companyid=1001");
Now, when the user click back button and submits the form1 again. you can check for companyid in querystring and update the company.
I think it is more user-friendly when user can return back to previous form and update it (instead preventing the described behavior).
I use in most cases similar way to handle described problem:
Let's assume that user is on the page /some-page, that contains "Create new company" button.
When the user opens this page, will be executed special method createOrFindCompanyDraft() on the server-side. This method creates new company "draft" record in DB (only for the current user). For example, draft record has primary key id=473. When you execute this method again it will return the same record with the id=473 (with "draft" status). "Draft" record should't display on any other interfaces.
And "Create new company" has link /company/common/473.
When user go to /company/common/473, you display form 1, that will be filled from "draft" record. At first time user will see empty form.
Technically user will update the existing record, but you can display "Create new company" title on the page.
Then user go to form 2, for example, /company/legal-info/473, you create similar draft record for the this form (similar to step 1).
When user submit the form 2, you will remove "draft" status from the record id=473 (and any related records).
Next time when user open page /some-page, will be created new draft record for the current user.
Browser history will contain:
/some-page
/company/common/473
/company/legal-info/473
/some-page2
I like this approach, because all form only update records. You can go to previous/next form many times (for example "Back"/"Forward" browser buttons). You can close browser, and open not completed forms tomorrow. This way doesn't require any additional manipulation with the browser history.
try this
<form autocomplete="off" ...></form>
And Another
Use temporary tables or session to store the Page 1 form data. If the page 2 form is submitted use the temporary data of page 1 which is stored in database or in session.
Use a Separate key (Hidden field ) in both page 1 and page 2.
Actually I thought of a trick to obtain that "create on first post, update after" behavior (just like the user thinks it should behave).
Let's say the step 1 form is at the URL /create_company/. Then I could have that page generate a random code XXX and redirect to /create_company/?token=XXX. When I create the company I save the information that it was created through page with token XXX (for instance, I save it in user's session as we don't need to keep that information forever) and when the form is submitted, if I know that a company was already generated using this token, I know the user used the same form instance and must have used the back button since the token would be different if he explicitly asked for another company.
What do you think ? (I initially thought there should be a simpler solution, as this seems a little bit over-engineered for such a simple issue)
This is more like a UX question.
I'd think that the solution lies within the information given to the user on that form, to help them understand what they're doing.
Set a title that says 'Create a company', for example, and set your submit button as 'Create Company' will help your user with that. Use a unique id when you create the company object, and pass the id back to the same URL in order to perform an update. You should then update your title and button that tells user that they are updating instead of creating.
In that sense I'd say it's better to use a more generic URL like /company and /company?id=12345.
You could also consider using Restful API protocol to help your server identifies the CRUD operation. http://www.restapitutorial.com/lessons/httpmethods.html
Without the "routing" part of django it is hard to help. I can just answer my experience from the express.js-router functionality:
you can specify a post on /company, which is for new users.
you can specify another route for post on /company/:companyid for a changing form
and as a response from the create-post you can redirect to the different location.

Wordpress - Create custom shortcodes for emails

I use a custom emailer that alerts me whenever a new user signs up to my wordpress members site. The shortcodes that i am currently able to include within my emails are:
[name] = Displays user name.
[username] = Displays user username.
[password] = Displays user password.
[first_name] = Displays user first name.
[last_name] = Displays user last name.
[email] = Displays the user email.
[admin_email] = Displays the admin email.
[blogname] = Displays the blog anme.
[siteurl] = Displays site url.
[loginurl] = Displayslogin url.
[login_url] = Displays login url.
[passwordlink] = Displays password reset link.
[reason] = Displays the reason.
[expire_date] = Displays user expire date.
[post_title] = Displays the purchase post title.
[purchase_cost] = Displays the purchase post cost.
[amount] = Displays the membership amount.
[currency_sign] = Displays the currency symbol.
[membership_type] = Displays the membership type.
I would like to include the following wp_usermeta info within the emails to so want to setup another custom shortcode for these emails:
_mgm_cf_show_details_in_member_directory
How would i tell wordpress to echo this information in a new shortcode, something like [member-directory].
Upon registration, user's enter yes or no for this question so i want the email alert to tell me whether they have chosen Yes or No.
I hope that all makes sense, thanks again guys.
Without looking at the code, I can't give you a definitive answer, but;
It should be as simple as adding in a new array key to the outputting array.
There will be something somewhere that sends the short codes to the the emails, and that will be an object, something like:
$return['name'] = $user->name;
and you just need to add something like:
$return['member-directory'] = $user->_mgm_cf_show_details_in_member_directory
something along those lines should get you there

Updating mysql email field without affecting

Recently I mass added customers details. However, my client just updated me that the email address format is wrong.
For example: The previous given email was abc#mail.com. However, I have to edit to this to abc#me.mail.com.
Is there any way I can check for #mail.com and change it to #me.mail.com?
update your_table
set email = replace(email, '#mail.com', '#me.mail.com')
where email like '%#mail.com'

MediaWiki: Special "Create an account" behaviour

When a new user account is created in our MediaWiki system, the admin specifies the desired user login name and the real name. I'd like to automatically fill the user page and also create a special page according to these rules:
Provided the login of the new user is "LOGIN" and the real name is "FIRST SECOND",
1) a new page should be created named "SECFIR" (i.e. 3 letters of surname and 3 letters of first name), containing just "#REDIRECT:[[user:LOGIN]]", i.e. redirecting to the user page;
2) the user page should contain "{{getuser|SECFIR}}"
Any suggestions?
Create a custom hook function (event handler) using http://www.mediawiki.org/wiki/Manual:Hooks/AddNewAccount - relatively straightforward PHP to do this
Same answer...
More at https://stackoverflow.com/a/8514696

Send email to dynamic recipient SSIS Send Mail Task

I have an SSIS package which is going to be deployed on test, staging, and finally production.
It has a couple of "Send Mail Tasks",say 10.
As developer, I put my email address as the recipient of the email.
Currently, for the test person, I need to change all the "To"s in all the script task to e.g. "TestPerson#test.com". If following the paradigm of hard-coding the emails this way,I need to change the recipient email 30 times!!! (10 for each stage stated above)
Just wondering if there is any way to inject To field(recipient) dynamically. e.g. from a variable. like I have done for the "MessageSource"
You can set the ToLine of the Send Mail task to be the value of a variable, using an Expression from the Properties window of the task.
We use a SQL table containing a list of email recipients for various conditions (table columns of kemail, emailaddress, success, error) and set flags in the table to 0=no, 1=yes for that particular user to receive emails on particular conditions.
Then create a variable that contains a delimited list of your recipients then use an expression to set "ToLine" for the send mail task.
The only thing to watch here is that you don't end up with a no records returned from the SQL table. We always have our "support" email address always having all the bits set, to avoid this.
So the package wont need to be modified when a new user needs to receive email updates.