Sean P. DeNigris wrote
> 
> Andy Burnett wrote
>> Using Google service discovery API's with Pharo Smalltalk by Richard J.
>> Prinz
> Cool! I noticed a small bug

I created a new repo at https://github.com/seandenigris/St-Google-API since
the original repo is self-hosted, I don't know what the contribution policy
is, and I need the fix to continue my work. I'll keep the MC meta info so
that my changes can be merged back if desired.

Fun fact. I was able to send a multipart text & html email after a few
gotchas. Here is the script in case someone wants to do the same:
        | api message raw |
        api := GoogleGmailApiUsersMessages new.
        api authenticate.
        message := MailMessage
                from: '"Mr. Sender" <m...@myurl.com>'
                to: { '"Mrs. Receiver" <m...@anotherurl.com>'. }
                about: 'Thank you!'
                asFollows: ''.
        message
                addAlternativePart: self plainTextString contentType: 
'text/plain';
                addAlternativePart: self htmlString
                        contentType: 'text/html'.
        raw := message asSendableText base64Encoded.
        "Web-safe base64 from
https://stackoverflow.com/questions/26663529/invalid-value-for-bytestring-error-when-calling-gmail-send-api-with-base64-encod";
        raw := raw copyReplaceAll: '+' with: '-'.
        raw := raw copyReplaceAll: '/' with: '_'.
        api send: 'm...@myurl.com' api options: (Dictionary with: 'raw' -> raw)

where #send:options: is just the generated #send: with an argument passed
through (instead of nil) as the last argument to:
        ...
        ^ self makeRequestTo: path usingMethod: action with: optionsDict.



-----
Cheers,
Sean
--
View this message in context: 
http://forum.world.st/Using-Google-service-discovery-API-s-with-Pharo-Smalltalk-by-Richard-J-Prinz-tp4814538p4859733.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to