[ui][views] Refactor email sending using helper

1 job from fix_email_sending in 17 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Build
failed #153124
docker
build

00:00:17

 
Name Stage Failure
failed
build Build
/bin/bash: line 73: /local/opt/conda/envs/beat_test_env/bin/python: No such file or directory
Running after script...
$ export BEAT_TEST_PREFIX=`cat $TEST_PREFIX_PATH_FILE`
cat: test_prefix_153124.txt: No such file or directory
$ echo "Deleting BEAT test prefix $BEAT_TEST_PREFIX"
Deleting BEAT test prefix
$ rm -rf $BEAT_TEST_PREFIX $TEST_PREFIX_PATH_FILE
$ unset BEAT_TEST_PREFIX
ERROR: Job failed: exit code 1