Woocommerce Custom Email path in Plugin - email

I create a custom order status and the . also cerated a custom email that are fired manually when the status is changed to my new custom status.
It works 100% if my custom email template reside in plugins/woocommerce/
\plugins/woocommerce/templates/emails/logistics-eft-paid.php
But i need to add the custom email to my childtheme.
themes/ms-store/woocommerce/emails/logistics-eft-paid.php
I used this plugin, and I realise that woocommerce_get_template is outdated and replaced by wc_get_template, but is simply can't get it to work.
Even if I can hardcode the path to the email template, it will be a start.
Plugin used:
https://github.com/skyverge/woocommerce-expedited-order-email
Any help will be appreciated,
Thank you.

Related

Custom tags in Jira email handler

Is there a way to make a Jire email handler ignore the From field in an email and go for a custom tag instead? I know I could work with the API instead but that's in the pipe. this is a temporary solution that will be used until a more robust system is built.
To clarify what we have today:
Email is sent to inbox, (hr#company.com)
Jira picks is up and creates an issue.
Jira looks at the From field and creates a uses if none exist.
What we're trying to achieve:
Form is filled out, and an area is chosen (hr, facilities etc.).
Form is posted to an API that creates an email (basically a no-reply adress over SMTP) and sends it to the appropriate inbox (for example hr#company.com).
Email lands in the inbox and Jira looks in it and creates an issue in project or label 'HR'.
Jira now looks in the email and finds custom tags named [user] and [user-email] (or something) and creates a user from the tag.
Example email
From: no-reply#company.com
To: hr#company.com
Subject: Some problem
Body: Explanation of problem
Have a good day!
/Mike
[user:"Michael Smith"]
[userEmail:"michael.smith#company.com"]
If we were to implement this system now, we would loose the possibility to create new users because all emails would come from the same "no-reply" adress.
I have searched in the Atlassian forums and such, but with no luck. Have not found anything in the official documentation, but I fear that I might be looking in the wrong place.
I hope that I'm being clear, and that someone has any idea if it is possible.
Thank you!
You need to write your own plugin and create your own Mailhandler.
For example you can use a regex which looks for the tag
[userEmail:"michael.smith#company.com"] and retrieve the emailadress from the string. Do the same for the [user]-tag, if the user doesn't exist.
Here is a tutorial that shows how to create and setup custom Message Handlers:
https://developer.atlassian.com/jiradev/jira-platform/guides/email/tutorial-custom-message-mail-handler-for-jira#Tutorial-Custommessage(mail)handlerforJIRA-Step7:Implementarealmessagehandlerback-end
The rest should be easy from here.

Customizing password reset mail View in Laravel

How can I change what appears in the password reset email in laravel?
Like addressing the user with his name and show the password reset link etc.
Where is that email view located?
In Laravel 5.3 they changed the entire password reset code, so the given answer doesn't work anymore.
If you want to change the basic texts you should copy vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php to some place in your own app (e.g. app/Notifications/ResetPassword.php), set the correct namespace and alter the texts as you wish. (don't alter the original ResetPassword.php since it's bad practice to alter files in the vendor folder!)
Then add a sendPasswordResetNotification method to the User class and make sure to reference to the appropriate ResetPassword class:
use App\Notifications\ResetPassword;
...
public function sendPasswordResetNotification($token) {
$this->notify(new ResetPassword($token));
}
If you want to change the rest of the mail template (which is used for all other mails as well) do the following:
Run php artisan vendor:publish
This will copy some blades from the vendor folder to the resources/views/vendor
The resources/views/vendor/notifications/email.blade.php is the one you want to change.
Hope this helps for people who got stuck in Laravel 5.3
Yes you can change the email template, which is located at
resources/views/emails/password.blade.php.
For customization pass an instance of User model to this view and echo out user name there like:
Hello, {{$user->username}}
//And Body of Reset link goes here
Update for laravel 5.3+
In updated laravel versions the code structure is revamped.
Password reset mail is now at vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php
and its corresponding template is at:
resources/views/vendor/notifications/email.blade.php
So in order to customize it, you may need to:
Copy it to somewhere in your app's directory.
Set the proper namespace to refer to it.
Add a new method to User class & reference it to newly copied class
Customize.

How can i change Confirmation email text in rails 4 , i want to send custom text for confirmation when using "confirmable"

Can anyone tell me , how can i change Confirmation email text in rails 4.
I want to send custom text for confirmation when i use "conformable" in rails with devise
Right now email sent is below
Welcome user email here.
You can confirm your account email through the link below:
Confirm my account
Thanks
It's pretty straightforward and Devise has great documentation here which you can reference if you get stuck: Custom Mailers on Devise
Here's the summarized step-by-step:
Create a custom mailer class. You will put this code in your /lib directory. In you /lib directory, create a file called lib/my_mailer.rb and copy the code there. You will then need to require this new class and you can do this at the top of initializer/devise.rb.
lib/my_mailer.rb
class MyMailer < Devise::Mailer
helper :application # gives access to all helpers defined within `application_helper`.
include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url`
end
And then in config/initializers/devise.rb
require 'my_mailer'
Devise.setup do |config|
.
.
.
end
The next step is to update the devise mailer setting to point to my_mailer
config/initializers/devise.rb
config.mailer = 'MyMailer'
The last step is to copy the devise mailer views from the Devise gem into a new views folder directly in your app. So inside the Devise gem you are going to go to app/views/mailer and copy the three files from there and paste them into a new directory in your App. You will need to name this new directory in your app as follows app/views/my_mailer/
From there you can directly edit the mailers to your liking.
Hope this helps!

load magento email template

I'm using my own code to send out SMS's to the customers at the same time as the emails go out. I do this by getting the email template code with
$code = $this->getTemplateCode();
and then trying to load the corresponding SMS template with
$sms = $this->loadByCode('sms_'.$code)->getTemplateText();
I then check if $sms is empty before proceeding to send the text, meaning that I can add or remove connected SMS templates at will. The problem I'm having is that I sometimes, when there is no connected "sms_*" template, I get the full email sent out as the SMS instead of no text being sent.
I've debugged the code by sending out the template it tries to load as the actual SMS, and received "sms_creditmemo", but when I instead load it with the method above and do a var_dump($sms); exit;it shows me that it loaded the template "creditmemo_invoice" which is the email template I use instead of "creditmemo" when the payment method is detected. I make sure to use the original template string in $code (used to load SMS template) no matter the payment method.
Now my question would be how this can even be possible, does the loadByCode take best matching template or is there some other more serious bug I've missed, maybe there's better ways to load in the templates and make correct checks to see if they even exist?
I solved this by checking if the correct email template gets loaded with
if ($this->loadByCode($template)->getTemplateCode() == $template)

Force.com email service

I have created an email service in force.com.Can anyone help me out of how to use thta in apex classes.say,i wanna send mail when user registration is successful??
Many Thanks,
Sandhya Krishnan
I assume you want to send an email directly from Apex code, either in a Trigger or from a page controller ... ? If so, this page can get you started:
http://www.forcetree.com/2009/07/sending-email-from-your-apex-class.html
Clearly you don't want to hard-code your email template into your classes, so make sure to read at least through the part that shows how to look up the template dynamically. That should be enough to get you on your way.