There is a php form in our website. After submitting the form, email will go to our company's email address (sample: support@company.com). Also, an issue is being created in Jira from that email/form. Those setting has been enabled already in jira. To send the email, an email of our company is to set in Form filed in the php. Without that gateway, message can't be send to our email address. So, the sample code is:
$fromName = $_POST['username'];
$fromEmail = $_POST['email'];
$mail->From = 'any@company.com';
$mail->FromName = 'Company';
$mail->addAddress('support@company.com', 'Company');
$mail->addReplyTo($fromEmail, $fromName);
$mail->Body = "<p>You have got a email from <b>{$fromName}<{$fromEmail}></b></p>";
$mail->Body .= "<p><b>The actual message is given bellow</b></p>";
The problem is, at jira, it says:
You have got a email from userName<user@gmail.com>
The actual message is given bellow
And it sets our email address (any@company.com which we set in $mail -> From) as reporter in stead of user's email (user@gmail.com, the email we collect by $fromEmail) for that issue. So, the problem is, when we reply at that issue, it goes to any@company.com instead of user's email address (user@gmail.com). How to fix this?
For such customization you will have to use an plugin
https://marketplace.atlassian.com/plugins/com.javahollic.jira.jemh-ui/cloud/overview
or
https://marketplace.atlassian.com/plugins/biz.beag.jira.mailer/server/overview
Is the user's email actually mentioned in the "from" mail section in your company mailbox which the JIRA reads, can you confirm that
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also from the official docs, this is what is supported, without requiring the plugin. You have to use it while configuring the mail handler
Default Reporter
Specify the username of a default reporter, which will be used if the email address in the From: field of any received messages does not match the address associated with that of an existing JIRA user — for example, a JIRA username such as emailed-reporter
(info) Note:
This option is not available if the Create Users checkbox is selected.
Please ensure that the user specified in this field has the Create I ssues project permission for the relevant Project (specified above) as well as the Create Comments project permission for the other relevant projects to which this mail handler should add comments.
When an issue is created and this option is specified, the email message's From: field address is appended in a brief message at the end of the issue's Description field, so that the sender can be identified.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your response. I don't have access to the company mailbox right now. I see all the messages at jira issue collector. I'll try to access the mailbox directly and confirm. By the way, for sending the message from website, phpMailer has been used: https://github.com/PHPMailer/PHPMailer/blob/master/examples/contactform.phps
I haven't found any installed plugin for email handling. That means, it was configured without plugin probably.
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As mentioned in the configuration "You haven't provided default reporter" , thus if the "from" email address is not mapped to any username then it will be ignored. Thus, your company address is mapped to some username which becomes the default repoter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
okay, but I don't want to set any default reporter. I want sender's email address as reporter. Sender can be new or any existing jira user. I want it to generate from the input of the form.
$fromEmail = $_POST['email'];
What should I do then?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since a long time i look for a solution for your question.
I haven't found one.
You found anything that works for this?
I Need the same
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.