Help with customer suport use case: how to reply to created tickets?

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

seanm
Posts: 19
Joined: 06 Jan 2021, 22:34

Help with customer suport use case: how to reply to created tickets?

Post by seanm »

Hi all,

I'm looking to auto generate tickets when our company's customers send email to support@example.com (that much I now have working). But how then do our employees:

1) know that such a ticket was created?
2) reply to the customer?

For 1, I suppose we just rely on Mantis' built-in ability to send email upon ticket creation?

For 2, I thought that adding a note to the ticket would send out an email, but this does not seem to occur. Unless I've configured something wrong.

Any help on how to achieve this use case would be appreciated!

Thanks.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Help with customer suport use case: how to reply to created tickets?

Post by cas »

I have a plugin available that sends out an email to the customer once ticket is created, perhaps that helps for case 2 :mrgreen:
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Help with customer suport use case: how to reply to created tickets?

Post by SL-Gundam »

MantisBT has a notification system but it might be that you need to set it up correctly
You also need to make sure the reporter of the ticket has a valid and correct email address connected to his account.

The notification system can notify your employees about new tickets. It can also notify your customers about various undertaken actions if so desired.
seanm
Posts: 19
Joined: 06 Jan 2021, 22:34

Re: Help with customer suport use case: how to reply to created tickets?

Post by seanm »

>You also need to make sure the reporter of the ticket has a valid and correct email address connected to his account.

Who is "the reporter"? Currently, on my email server I have created support@example.com and I have created an account in Mantis for support@example.com. Sending email (from anywhere) to support@example.com successfully creates a ticket. Is support@example.com "the reporter" here? Or are you saying that Mantis accounts are needed for every possible source email? If so, that's impossible for my case, I don't know all my customers' email addresses.

>The notification system can notify your employees about new tickets.

Yes, after tweaking $g_notify_flags appropriately, I can now get Mantis to send emails to employees that should know about a support email from a customer.

>It can also notify your customers about various undertaken actions if so desired.

This is where I'm unclear. If someguy@gmail.com emails support@example.com, my ticket is created, Mantis emails me to say the ticket was created... now what? What's the workflow supposed to be? I had imagined that adding a note to the ticket would email someguy@gmail.com, but it doesn't.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Help with customer suport use case: how to reply to created tickets?

Post by SL-Gundam »

Take this ticket: https://www.mantisbt.org/bugs/view.php?id=27854
sintaq is the reporter. Comparable to someguy@gmail.com.
SL-Gundam (me) would be comparable to your employees in this case
support@example.com is only the mailbox where notes and issues are received. support@example.com has no relation to the actual tickets and notes once they are processed into MantisBT

EmailReporting only deals with processing emails into issues or notes. MantisBT is responsible for the notifications. MantisBT can only send notifications to accounts with valid emailaddresses. That means that everybody that sends emails towards support@example.com should also have an account in your MantisBT installation.
There are various ways how this can happen.
1. They create the accounts themselves. Not really reliable in my opinion.
2. You can create the accounts for them. Works only if there are not that many. I understand there are quite a lot and you don't have all the email addresses for the accounts so not really an option either
3. Let EmailReporting create the accounts automatically if needed: http://www.mantisbt.org/wiki/doku.php/m ... uto_signup
Please also have a look at the "Issue reporter configuration options" on the EmailReporting "Manage Configuration Options" page

If the security risk is acceptable then option 3 would be best based on the information you've provided.

As for the notifications to your customers. I suggest you have a look at the following pages in your MantisBT installation:
"Manage" -> "Manage Configuration"
-> "Workflow Thresholds"
-> "Workflow Transitions"
-> "E-mail Notifications"
seanm
Posts: 19
Joined: 06 Jan 2021, 22:34

Re: Help with customer suport use case: how to reply to created tickets?

Post by seanm »

First, thanks for your fast and detailed replies!

>EmailReporting only deals with processing emails into issues or notes.

Got ya. And for all outgoing emails it relies on MantisBT's existing abilities. I see now.

Your options 1 and 2 are impossible. Option 3 is really far from ideal.

Perhaps EmailReporting is just not suited to my needs. :(
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Help with customer suport use case: how to reply to created tickets?

Post by SL-Gundam »

It's never possible to have a suitable solution for everybody. You try to get close though

If you could explain how you would like it to work i could tell you how to get it done.
If option 3 is not suitable there is always the option of modifying the code yourself as needed. EmailReporting and MantisBT are open-source which makes this a viable option if you can invest the time needed.
seanm
Posts: 19
Joined: 06 Jan 2021, 22:34

Re: Help with customer suport use case: how to reply to created tickets?

Post by seanm »

So I've found a workflow that works reasonably well for us so far:

Our public support@example.com is actually a mailman list. I created a new IMAP email account foobar@example.com. I subscribed that account to the mailman list. EmailReporting uses IMAP to check the foobar@example.com account. Our support team are also subscribed to the mailman list. So everyone just uses 'reply-to-all' to reply to the customer and the list. As long as customers remember to 'reply-to-all' also, this works pretty well.

What do you think of that workflow? Foresee any issues?

I have seen a couple of occasions where a reply creates a new ticket instead of adding to the existing ticket. Are there known issues with that?

Cheers.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Help with customer suport use case: how to reply to created tickets?

Post by SL-Gundam »

Interesting solution. If it works for you that's very good.
There are a couple things to consider

"Readonly threshold for issues"
MantisBT by default makes issues read only on RESOLVED status. You might want to adjust that since it could be one of the reasons a note is instead turned into a new issue

Note identification
The below configuration options help identifying notes. Set them to "Yes"
"Use Message-ID in Mail header to identify notes"
"What kind of search should be used to find the issue id in the subject"

The processing order of IMAP
IMAP does not always return emails in a normal order (eg. old to new). EmailReporting tries to fix this but sometimes when emails are received within a couple seconds of each other this could not work properly. This also depends on the mail server. Some handle it better then others.

I advise updating to the latest DEV version since it's has some fixes for parsing concerning message id
https://github.com/mantisbt-plugins/Ema ... OG.txt#L11
https://github.com/mantisbt-plugins/Ema ... OG.txt#L12

It also contains an improvement to IMAP email order processing
https://github.com/mantisbt-plugins/Ema ... OG.txt#L15
seanm
Posts: 19
Joined: 06 Jan 2021, 22:34

Re: Help with customer suport use case: how to reply to created tickets?

Post by seanm »

Thanks for your reply.

I already have:
- $g_bug_readonly_status_threshold = CLOSED;
- Use Message-ID in Mail header to identify notes = yes
- What kind of search should be used to find the issue id in the subject = strict

But I'm not sure that last one is so relevant for me, since subject never have any mantis ticket number, since mantis never sends any mail in my setup.

I'm also already running your plugin from git master circa Dec 22, 2020. Looks like the fixes you referenced were made before that.

My mail server is running postfix and dovecot FYI.

I'll try to notice if the issue occurs with mails that are close in time. I'll also try to look at the logs...
seanm
Posts: 19
Joined: 06 Jan 2021, 22:34

Re: Help with customer suport use case: how to reply to created tickets?

Post by seanm »

SL-Gundam, I've noticed something else... sometimes customers will write to employees personally, for example to sean@example.com, instead of to the managed support@example.com address. When this occurs, our current workflow is for employess to use 'redirect' (not 'forward') to redirect the message to support@example.com. As I said previously, mailman runs support@ and indeed receives such messages and delivers them on to everyone, including to foobar@example.com (that the plugin checks). I logged into foobar's IMAP account via webmail and confirmed the message *is* there. Yet the plugin seems to ignore it completely.

Does the plugin expect/require/consult particular "To:" or "CC:" fields?

I can send you the message headers privately (off-forum) if that'd help.

Thanks.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Help with customer suport use case: how to reply to created tickets?

Post by SL-Gundam »

This answers what emails EmailReporting processes: https://www.mantisbt.org/wiki/doku.php/ ... ilbox_type
If EmailReporting runs into an unhandled error. The email will be retried on the next run. Most likely it will run into the same error so that would require manual corrections
If EmailReporting cannot process the email because of various settings, that result in an email being rejected, the email will be marked as processed and not be tried again. The only time you'll see why the email was not processed was on the run where EmailReporting tried to process it.

Have you tried doing a "complete test" and check the output?

If needed you can send me private messages through the forum
seanm
Posts: 19
Joined: 06 Jan 2021, 22:34

Re: Help with customer suport use case: how to reply to created tickets?

Post by seanm »

So is there no log file of the results of running each cron job?

Anyway, I disabled my cron job, used 'redirect' to send another message, and ran "bug_report_mail.php" manually, and looked at the output. Seems the problem is:

2021-02-15 12:36 EST MAIL_VERBOSE email_api.php:141 email_is_valid() Validating address '"Customer Name" <someone@somewhere.com> (by way of Employee Name <sean@example.com>)' with method 'html5'
2021-02-15 12:36 EST MAIL email_api.php:177 email_is_valid() failed - invalid address
Mailbox: SupportBotMailbox
Message: From email address rejected by email_is_valid function based on: "Customer Name" <someone@somewhere.com> (by way of Employee Name <sean@example.com>)

Looking at the raw headers as received, indeed we have:

From: "Customer Name" <someone@somewhere.com> (by way of Employee Name <sean@example.com>)

So your plugin is doing some validation of the 'From:' field I guess?

My reading of rfc5322 section 3.6.2 indicates that the above is a valid 'from' field.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Help with customer suport use case: how to reply to created tickets?

Post by SL-Gundam »

You can redirect the output of the job to a file. I suggest you google "output to file linux" (or windows depending on your OS)

email_is_valid() is a built-in function of MantisBT that validates email addresses.
If $g_validate_email is enabled in the MantisBT config file then EmailReporting will adhere to that configuration and validate it.
You can find documentation on the option here: https://www.mantisbt.org/docs/master/en ... nfig.email
Email addresses will only be validated by EmailReporting when the user cannot be found and the fallback to the default reporter is used
seanm
Posts: 19
Joined: 06 Jan 2021, 22:34

Re: Help with customer suport use case: how to reply to created tickets?

Post by seanm »

Yup, I can redirect the cron output, just wanted to make sure your plugin doesn't already have some log functionality built-in.

Thanks for the hint re: email_is_valid(). I've looked through the code a bit. I'll add some print statements and see if I can be sure exactly what's happening...
Post Reply