Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ical file should be sent as attachment on BPGES immediate notification #66

Open
boonebgorges opened this issue Apr 4, 2019 · 4 comments

Comments

@boonebgorges
Copy link
Member

I think we currently provide a link to download the .ics file, but it would be better (mail client would recognize) if we actually attached the .ics file. This is a request from the folks at MLA, and I can work on it for them in a couple weeks, but it's a good enhancement for the plugin more generally.

ccing @r-a-y just as an fyi :)

@nalonsopress
Copy link

Moving this here in case there's confusion:
PHP Warning: file_get_contents(BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Humanities Commons//NONSGML Events//EN CALSCALE:GREGORIAN X-ORIGINAL-URL:https://[email protected] STATUS:CONFIRMED DTSTAMP:20190424T144028Z CREATED:20190424T184027Z LAST-MODIFIED:20190424T184027Z DTSTART;TZID=America/New_York:20190424T150000 DTEND;TZID=America/New_York:20190424T160000 SUMMARY: asdfasdfasdf DESCRIPTION: asdfasdfasdf X-ALT-DESC;FMTTYPE=text/html: <p>asdfasdfasdf</p> ORGANIZER;CN="Jennifer Jones":MAILTO:[email protected] URL;VALUE=URI:https://hcommons-dev.org/events/event/asdfasdfasdf/ END:VEVENT BEGIN:VTIMEZONE TZID:America/New_York BEGIN:STANDARD TZOFFSETFROM:-0400 TZOFFSETTO:-0500 DTSTART:20181104T060000 TZNAME:EST END:STANDARD BEGIN:DAYLIGHT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 DTSTART:20190310T070000 TZNAME:EDT END:DAYLIGHT END:VTIMEZONE END:VCALENDAR ): failed to open stream: No such file or directory in /srv/www/commons/current/web/app/plugins/sparkpost/mailer.http.class.php on line 175

@r-a-y
Copy link
Member

r-a-y commented Apr 24, 2019

@nalonsopress - I mentioned in the other thread that your bug appears to be caused by your usage of the SparkPost WP plugin. Maybe they did not implement all of PHPMailer's properties.

@nalonsopress
Copy link

nalonsopress commented Apr 24, 2019

It's a file_get_contents issue, it's expecting a path, but @boonebgorges passed it a variable. Sparkpost corrected this it looks like , we just need to upgrade. When I implemented this patch, it works fine.

protected function read_attachment($data)
   {
        // If the provided String is a File Path, load the File Contents. If not, assume the String is the contents
        // This allows PHPMailer's addStringAttachment() method to work thereby avoiding the need to store a file on the server before attaching it
        if ( is_file( $data ) ) {

            return file_get_contents($data);
        }
        else {
            return $data;
        }

Thanks again guys.

@boonebgorges
Copy link
Member Author

Ah, interesting. I intentionally used PHPMailer's addStringAttachment() so that I didn't have to store a file :) If this is just a problem with SparkPost's integration, then I think I'll leave as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants