EBMS Tickets

Issue Number 749
Summary [Hotel & Reimbursement Requests] Send to group email
Created 2023-03-13 12:25:39
Issue Type Improvement
Submitted By Shields, Victoria (NIH/NCI) [E]
Assigned To Kline, Bob (NIH/NCI) [C]
Status Closed
Resolved 2023-04-10 07:02:58
Resolution Fixed
Path /home/bkline/backups/jira/oceebms/issue.340777
Description

Please add these emails as recipients for Hotel Requests and Reimbursement Requests:

nciocplpdq@mail.nih.gov

vshields@mail.nih.gov

Comment entered 2023-03-13 12:45:32 by Kline, Bob (NIH/NCI) [C]

On production? Or some other tier(s)?

Comment entered 2023-03-21 14:16:40 by Juthe, Robin (NIH/NCI) [E]

On production. Thanks Bob!

Comment entered 2023-03-21 15:11:39 by Kline, Bob (NIH/NCI) [C]

New addresses added.

Comment entered 2023-03-21 15:37:25 by Juthe, Robin (NIH/NCI) [E]

Sorry, could you please add one more email as a recipient of both forms? 
NCITravel@jbsinternational.com 
Thanks.

Comment entered 2023-03-21 17:31:20 by Kline, Bob (NIH/NCI) [C]

Hmm, teensy problem. We've gone 10 years in the CDR with just two addresses, so it's unexpected that we'd exceed the limit of 128 characters. This is all I can fit right now

 

charles.ziscovici@nih.gov,dominic.cooper@nih.gov,robin.juthe@nih.gov,vshields@mail.nih.gov,nciocplpdq@mail.nih.gov,NCITravel@jbs

We can add a ticket to Fiordland to see if we can enlarge that limit, but for right now we'll have to decide which addresses are really needed.

Comment entered 2023-03-22 09:32:34 by Juthe, Robin (NIH/NCI) [E]

Good news for now - we can remove Charles and Dominic since they no longer work here. That should give us enough room for the full JBS email. Thanks!
charles.ziscovici@nih.gov,dominic.cooper@nih.gov,

Comment entered 2023-03-22 09:49:48 by Kline, Bob (NIH/NCI) [C]

Good news for now - we can remove Charles and Dominic since they no longer work here.

Excellent! We're all set.

(I'm moving away from using "Reply" in JIRA. My current working theory is that struggles to keep track of the reply threading is contributing to—if not causing—the "disappearing comments" bugs.)

Comment entered 2023-03-22 09:52:42 by Kline, Bob (NIH/NCI) [C]

Well, that's bizarre. I hit "Add Comment" instead of "Reply" for that last comment, but JIRA still made it a reply to some other random comment. And it won't let me delete it. 🙁

Comment entered 2023-03-22 09:54:27 by Kline, Bob (NIH/NCI) [C]

Anyway, the travel manager email addresses are all set.

Comment entered 2023-03-31 14:23:40 by Juthe, Robin (NIH/NCI) [E]

Unfortunately, Terry at JBS still isn't receiving these emails from the EBMS. Just wanted to confirm that the change was made on PROD. If so, could you please also make the change on a lower tier (whichever one you think is most appropriate) so we can do some testing? Thanks.

Comment entered 2023-03-31 15:42:04 by Kline, Bob (NIH/NCI) [C]

OK. Now DEV and PROD have the same value for the Travel Manager Email Address(es) field:

robin.juthe@nih.gov,vshields@mail.nih.gov,nciocplpdq@mail.nih.gov,NCITravel@jbsinternational.com

Please check what I have for typos (and test on DEV, of course 😉).

I would think, however, that since you're one of the recipients, and (as far as I know) the mail server we're using doesn't do that trick where each recipient's copy looks like that recipient is the ONLY recipient, you should probably be seeing all of the addresses on the TO line, right? So if NCITravel@jbsinternational.com is one of the addresses you see, then i would say the problem is not likely to be in the EBMS software (by which I mean, it can't be, unless my understanding of how email works is a complete shambles, which would be a really bad sign for how well my cognitive facilities are holding up, given all of the email gateways I wrote earlier in my career). Anyway, I look forward to hearing the results of your testing.

Comment entered 2023-03-31 16:06:11 by Kline, Bob (NIH/NCI) [C]

First piece of information is a minor bit of good news: the server name (showing the tier) is only added for the non-production servers, so the fact that you're not seeing it for the production messages is not a problem. In fact, that's how you know it's prod: it doesn't show the server address.

Comment entered 2023-03-31 16:43:16 by Kline, Bob (NIH/NCI) [C]

The next piece of information is not such good news. There's a bug in the code which is causing the messages to fail, but only on production. The page where I set the recipients is setting the value of the

 

email_travel.email.travel_manager

variable. But the reimbursement request for and the hotel request form are both looking for the

email_travel.email.manager

variable.

So you'll want to put a ticket in to have me fix that bug. Very unfortunate that we didn't test this path. Sorry about that! 🙁

Comment entered 2023-03-31 16:46:54 by Kline, Bob (NIH/NCI) [C]

The bug is fixed on DEV and the temporary tweak to the code is in place to make it behave as if it's the production server (so sending the messages to you, Victoria, and me). And you can still test that if you want, though I think the mystery is already solved.

Comment entered 2023-03-31 17:36:44 by Juthe, Robin (NIH/NCI) [E]

I've confirmed this is working as expected on DEV. I received the emails.

Comment entered 2023-04-10 07:02:58 by Kline, Bob (NIH/NCI) [C]

Moved to Fiordland since it can't be completely tested until the parallel ticket for the bug fix (OCEEBMS-751) is deployed to production.

Comment entered 2023-04-28 13:20:12 by Juthe, Robin (NIH/NCI) [E]

Hi , could you please add my email and Victoria's email to the list of recipients for the hotel request and reimbursement request forms on QA? Once I confirm that's working I may also ask you to add the JBS email just to be completely sure. Thank you!

Comment entered 2023-04-28 13:51:42 by Kline, Bob (NIH/NCI) [C]

Adding those addresses won't let you test what you want to test here. On every tier except production the software gets its list of recipients from the "developers" configuration variable instead of the "travel_manager" configuration variable. That's a deliberate decision we made so testing on the lower tiers doesn't spam the folks who get the real notifications from activity on the production server. I could manually change the code so that QA thinks it's the production server for this purpose, but then you wouldn't be testing the code we're going to deploy to production next week (give or take). That's why I wrote earlier that this ticket "can't be completely tested until the parallel ticket for the bug fix (OCEEBMS-751) is deployed to production." Make sense?

Remember, the problem wasn't that NIH wasn't able to deliver email to certain addresses. We're pretty confident that whatever valid email addresses we enter will be able to get email delivered by NIH. The problem was that the code sending out the notification was using a different name for the configuration variable than the name being used by the form which lets me set the variable's value. Here's the code which sends out the notification:

 

/**
   * Notify the travel manager that we have a new hotel request.
   *
   * @param array $values
   *   Values from the form.
   */
  private function sendEmailNotification(array $values) {

    // Make sure we have someone to whom we can send the notification.
    $subject = 'Hotel Request';
    $host = $this->getRequest()->getHost();
    if ($host === 'ebms.nci.nih.gov') {
      $to = $this->config('ebms_travel.email')->get('travel_manager');
    }
    else {
      $to = $this->config('ebms_travel.email')->get('developers');
      $subject .= " ($host)";
    }
    ...
  }

That line which now has get('travel_manager') used to be:

      $to = $this->config('ebms_travel.email')->get('manager');

Here's the code which stores the values on the form for managing those email addresses:

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $trigger = $form_state->getTriggeringElement()['#value'];
    if ($trigger === 'Save') {
      ....
      $config = $this->configFactory()->getEditable('ebms_travel.email');
      $config->set('travel_manager', $form_state->getValue('travel-manager'));
      $config->set('developers', $form_state->getValue('developers'));
      $config->save();
      $this->messenger()->addMessage('Saved travel configuration.');
    }
    $form_state->setRedirect('ebms_travel.landing_page');
  }

The important part is the $config->set('travel_manager', ...); which has always been that way. With this fix the code above (sending out the notification) now matches that the use of that name.

Hope this helps clarify things.

Comment entered 2023-05-01 12:09:36 by Juthe, Robin (NIH/NCI) [E]

Got it. Thanks, Bob. I was trying to replicate the testing we did on DEV but now I see that you had manually applied the code from prod in order for us to test. Since that was successful and we can't test this completely until the other bug fix is on prod, I think we can proceed without testing this one on QA.

Comment entered 2023-05-03 17:09:56 by Shields, Victoria (NIH/NCI) [E]

As Bob has noted, we aren't really able to test this issue, but I'm moving to QA Verified.

Comment entered 2023-05-10 14:59:57 by Juthe, Robin (NIH/NCI) [E]

, now that this fix has landed on PROD, I just wanted to confirm that the following emails are set up to receive hotel and reimbursement requests on PROD. Thank you!

robin.juthe@nih.gov,vshields@mail.nih.gov,nciocplpdq@mail.nih.gov,NCITravel@jbsinternational.com

Comment entered 2023-05-10 15:11:46 by Kline, Bob (NIH/NCI) [C]

Yes, that's correct. Latest hotel request was April 28, and latest reimbursement request was the 17th, though, so we won't have actual evidence until we get a new travel request.

Comment entered 2023-05-16 18:53:55 by Shields, Victoria (NIH/NCI) [E]

As of today, no one has submitted a hotel or reimbursement request since the release was deployed. The Pediatric Board has an in-person meeting on May 19, so hopefully some submissions will come in the following week.

Comment entered 2023-05-22 11:09:46 by Kline, Bob (NIH/NCI) [C]

Looks as if we have a couple of reimbursement requests. Can you confirm that the contractor got the notifications?

Comment entered 2023-05-25 10:33:29 by Shields, Victoria (NIH/NCI) [E]

I can confirm that these requests are going to the contractor's travel box. Hooray!

I'd like to see a hotel request come through before I close this ticket. The next in-person meetings is for Peds, and we've asked Crystal to reach out to her group and ask them to start making reservations.

Comment entered 2023-06-01 10:44:54 by Shields, Victoria (NIH/NCI) [E]

I submitted a hotel request for test board member and it was received by the travel contractor. We feel confident that this is working so I'm closing the ticket. Verified on PROD.

Elapsed: 0:00:00.000667