Email output could be much prettier

General discussion about MantisBT Plugins

Moderators: Developer, Contributor

mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Email output could be much prettier

Post by mushu »

Yay! It's working now. Okay now that I'm getting the correct output I can start to really test it...will post issues as I find them. Thanks again!
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Email output could be much prettier

Post by mushu »

So still getting errors from bad index, so I added "@" in front of those variables to hide the error...although a bad index sounds important to not just ignore lol.

$variables['severity'] = get_enum_element( 'severity', $issue_data['email_severity'], auth_get_current_user_id(), @$issue_data['project_id'] );
$variables['status'] = get_enum_element( 'status', $issue_data['email_status'], auth_get_current_user_id(), @$issue_data['project_id'] );
$variables['priority'] =get_enum_element( 'priority', $issue_data['email_priority'], auth_get_current_user_id(),@$issue_data['project_id'] );
$variables['tags'] = @$issue_data['email_tag'];
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Email output could be much prettier

Post by mushu »

Yeah not able to use it, now entering a new issue gets me this error:

SYSTEM NOTICE

'Undefined index: email_due_date' in 'C:\MantisBT2243\core\template_api.php' line 24

Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Email output could be much prettier

Post by cas »

Change error reporting to Error only, it will remove the system notices. That way you can continue. I will review these notices later :mrgreen:
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Email output could be much prettier

Post by mushu »

Got it. DISPLAY_ERROR_NONE

Thanks. Everything seems to be working fine. Made a few changes to the CSS but otherwise I removed all "@" in front of variables since errors are now ignored. Hope that doesn't bite me in the butt.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Email output could be much prettier

Post by cas »

No it will not for now. I will change my setup to display all messages and will fix them somewhere this week. Then I will post version 3 :D
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Email output could be much prettier

Post by cas »

if you open up my bug_mailtemplate.html, you can remove the comment tags on line 76 and 80.
Next you will get additional information in the overview:
- The array that holds all data
- The referer from which the script is called.

Most of the index errors you mention, I cannot reproduce. Due_date, Project_id etcetera are normal valid fields which should be present in the array.
Please check and let me know what you find.
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Email output could be much prettier

Post by mushu »

referrer = /bug_report_page.php

all history = Date Username What Change
2020-10-26 13:41 usr1 New Issue
2020-10-26 13:41 usr1 Status new => assigned
2020-10-26 13:41 usr1 Assigned To => usr1

But of course this is still ignoring errors using the constant above.
Last edited by mushu on 26 Oct 2020, 20:53, edited 1 time in total.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Email output could be much prettier

Post by cas »

You have activated 3 lines, most interesting is the last one. This print the array with all available data.
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Email output could be much prettier

Post by mushu »

Is there a nice list of every file that needs to be kept from being overwritten when upgrading to a new version? We are using v2.24.3 and need to upgrade to the latest so we don't fall too far behind. We have already updated our PHP from v5 to v7 so should be good there for a while.

I just know that if I blindly copy over the existing files our beautiful email templates will go away and we don't want that to happen! if there was a single place that listed every file that was modified and where they belong, then i could go through and run a diff on the old/new files and recreate the code changes in the latest version when i do the upgrade on our server.

TIA!
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Email output could be much prettier

Post by cas »

in this case changes made within mail_api.php , residing in the core directory ( as described in the readme) :mrgreen:
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Email output could be much prettier

Post by mushu »

So that is the only file that changed? I did all of this too long ago to remember, sorry.

Also, where can I download the latest version of this so I can re-enable error messages?
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Email output could be much prettier

Post by cas »

last one is attached to this forum thread on page 1 :D
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Email output could be much prettier

Post by mushu »

cas wrote: 26 Oct 2020, 19:26 I will change my setup to display all messages and will fix them somewhere this week. Then I will post version 3 :D
Specifically I'm waiting for this release so I can turn on error messages again. ;-)
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Email output could be much prettier

Post by cas »

ah, started that at the time but nevergot to finalizing it. Will have a :mrgreen: look since it is fairly easy
Post Reply