Closed smach closed 2 years ago
As long as emayili can handle your input, everything should work fine. Check that you're supplying envelope
with what it expects.
Thank you. I checked with the creator of emayili who posted "unfortunately, the support in {Microsoft365R} is based on a very old version of {emayili}. A bit of work would be required to get it compatible again. I feel that the API of {emayili} has now stabilised, so it would be a reasonable thing to do at this stage." I'm not sure if you want to do that, but if not, you may want to change the Microsoft365R documentation that says it's compatible now.
"Very old version", lol. It was one minor revision ago from earlier this year. Anyway, I've pushed a compatibility fix in the emayili-update branch. Can you try installing that and tell me if it works?
@datawookie can you let me know if there are any issues with the fix? I'm not a heavy user of emayili.
"Very old version"
A lot has changed in the package since then, so, yes it was a much older version.
Hi @hongooi73,
Thanks for being so responsive in sorting out this issue.
I had to fiddle around a bit to get the tests to run. For future reference I'm going to record here what I needed to do.
.Renviron
file with the following contents.AZ_TEST_NATIVE_APP_ID="d44a05d5-c6a5-4bbb-82d2-443123722380"
AZ_TEST_OUTLOOK_FROM_ADDR="anne@example.com"
AZ_TEST_OUTLOOK_TO_ADDR="bob@example.com"
AZ_TEST_OUTLOOK_CC_ADDR="jane@example.com"
AZ_TEST_OUTLOOK_BCC_ADDR="rex@example.com"
devtools::test()
from the console rather than running tests via the GUI.And this is the result that I got for the relevant tests:
WDYT? I'm not quite sure why those few tests are failing and don't have the bandwidth now to dig in to figure it out. I'm assuming that you might have some ideas given your familiarity with the code. Very happy to bounce back and forth until we get this sorted.
Thanks, Andrew.
Don't worry about test05_outlook and test05d_outlook_send, these are for testing code that's unrelated to emayili. The only tests that should be affected are test05b_outlook_email and test05c_outlook_attachment, and they are passing.
I just need someone who can give the code a more thorough workout, since I don't usually send email from R myself. I've tested the basic use cases but there may be some corner cases that break.
Aha! Okay, cool, let me see if I can put together a some more detailed tests. :+1:
@hongooi73 I've done some independent testing and this looks good to me.
Hi @smach, can you please try installing from the emayili-update
branch and then testing again?
Also, please check out the test-compatibility-microsoft365r.R
file in the {emayili}
repository for a slightly different approach to using {emayili}
with {Microsoft365R}
. Let me know how it goes.
Thanks, Andrew.
@hongooi73 The test code works now, thanks!!! This is great.
@datawookie I used part of the test-compatibility-microsoft365r.R file and it seems to work fine too! The only thing I noticed is that I wasn't able to add more than 1 email address in the envelope()
to
argument, either as one string or a vector, when I ran outlook$create_email(msg)
. I can certainly live without that, just thought it was possible.
Actually I just noticed that emayili handles addresses using a custom vctrs class. @datawookie can you have a look at my comment in the linked PR?
@hongooi73 just had a look and it's :fire:.
I was able to successfully run the example above, but ran into problems when I tried to take rendered HTML from {emayili} and pass it into {Microsoft365R}. The link below demonstrates a minimal example of the issue.
https://github.com/datawookie/emayili/issues/99#issuecomment-1445282353
I am trying to use emayili with my business Outlook. I tried to run this code from what I saw in your unit tests:
but my
folder
is authenticated withget_business_outlook()
and my "test emayili email" is a "test.html" file, and I get this error:Error: $ operator is invalid for atomic vectors