Page MenuHomePhabricator

Build the extension (Extension:SparkPost)
Closed, ResolvedPublic

Description

Per request, https://meta.wikimedia.org/wiki/User_talk:X-Savitar#Would_you_pleased_to_write_a_sparkpost_email_extension_for_Mediawiki?

This is quite of an experiment but looking forward to see it used, Cc @Zoglun.

Event Timeline

D3r1ck01 created this task.Jan 3 2019, 8:34 PM
D3r1ck01 updated the task description. (Show Details)

@Zoglun, do you intend using this on a Wiki somewhere?

D3r1ck01 moved this task from Backlog to Doing [WIP] on the User-D3r1ck01 board.Jan 3 2019, 8:36 PM

Change 482156 had a related patch set uploaded (by D3r1ck01; owner: Derick Alangi):
[mediawiki/extensions/SparkPost@master] Add .eslintrc.json file for linting configs

https://gerrit.wikimedia.org/r/482156

Change 482159 had a related patch set uploaded (by D3r1ck01; owner: Derick Alangi):
[mediawiki/extensions/SparkPost@master] Added LICENSE file and CoC file for the repo

https://gerrit.wikimedia.org/r/482159

Change 482156 merged by D3r1ck01:
[mediawiki/extensions/SparkPost@master] Add .eslintrc.json file for linting configs

https://gerrit.wikimedia.org/r/482156

Change 482159 merged by D3r1ck01:
[mediawiki/extensions/SparkPost@master] Add LICENSE file and CoC file for the repo

https://gerrit.wikimedia.org/r/482159

Change 482229 had a related patch set uploaded (by D3r1ck01; owner: Derick Alangi):
[mediawiki/extensions/SparkPost@master] Add some repo required files for SparkPost repo

https://gerrit.wikimedia.org/r/482229

Change 482229 merged by D3r1ck01:
[mediawiki/extensions/SparkPost@master] Add some repo required files for SparkPost repo

https://gerrit.wikimedia.org/r/482229

Change 482243 had a related patch set uploaded (by D3r1ck01; owner: Derick Alangi):
[mediawiki/extensions/SparkPost@master] Implement email delivery with onAlternateUserMailer() Hook

https://gerrit.wikimedia.org/r/482243

Change 482243 merged by D3r1ck01:
[mediawiki/extensions/SparkPost@master] Implement email delivery with onAlternateUserMailer() Hook

https://gerrit.wikimedia.org/r/482243

@Zoglun, do you have a valid API key and a sending domain to try it out?

Zoglun added a comment.Jan 7 2019, 6:27 AM

@Zoglun, do you have a valid API key and a sending domain to try it out?

Yes I do have. But I don't want to publish thoese api code here. How can I send you test api key privately?

I have an API key too as well @Zoglun but what I don't have access to now is configs to setup a sending domain, if you have that, then you can use the manual here: https://www.mediawiki.org/wiki/Extension:SparkPost, to test the extension on a local wiki instance. Let me know if you have any troubles. Thanks!

Zoglun added a comment.Jan 7 2019, 7:10 AM

I have an API key too as well @Zoglun but what I don't have access to now is configs to setup a sending domain, if you have that, then you can use the manual here: https://www.mediawiki.org/wiki/Extension:SparkPost, to test the extension on a local wiki instance. Let me know if you have any troubles. Thanks!

It seems that the Extension:SparkPost we got from gerrit have error.
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SparkPost
cd SparkPost
composer update

Once we enable it, the whole site get 500 error. and

PHP Fatal error: Uncaught ExtensionDependencyError: SparkPost is not compatible with the current MediaWiki core (version 1.31.1), it requires: >= 1.33.0.

Is it possible to get it work with MW 1.31? The Extension:SendGrid do support MW 1.31.

Yeah it's possible, let me drop the dependency!

@Zoglun, you can clone again, I just dropped the dependency. Let me know if you run into any more troubles. Thanks! :)

Zoglun added a comment.Jan 7 2019, 7:43 AM

After several tried, we keep getting error message:
{ "errors": [ { "message": "Message generation rejected", "description": "Sending domain sandbox option mismatch", "code": "1902" } ], "results": { "total_rejected_recipients": 0, "total_accepted_recipients": 1,

Still trying to figure our what this error is.

I think I know what is causing that. Let me quickly patch that up and then you will update your repo and try again.

You can now update your repo "git pull origin master" and then try again let's see if we'll have the same error or if it works!

Zoglun added a comment.Jan 7 2019, 7:52 AM

COOL!
I got the mail! Everything seems working very well.
Really appreciate your work!

Interesting! So 2 things to keep in mind from my end.

  1. I have a valid API key
  2. I don't have the configs for a sending domain (but you have)

So in that case, I'll be helping with the development and requests, and you'll be helping out with the testing right?

Also, a little more cleanup on the extension I think is needed and of course writing unit tests (my favorite). Thanks a lot and I think if you wish, I can add you as co-author for the extension if you intend to maintain it (code wise and user wise), should I?

Zoglun added a comment.Jan 7 2019, 8:14 AM

Interesting! So 2 things to keep in mind from my end.

  1. I have a valid API key
  2. I don't have the configs for a sending domain (but you have)

    So in that case, I'll be helping with the development and requests, and you'll be helping out with the testing right?

    Also, a little more cleanup on the extension I think is needed and of course writing unit tests (my favorite). Thanks a lot and I think if you wish, I can add you as co-author for the extension if you intend to maintain it (code wise and user wise), should I?

It's an honor to be list as a co-developer. I will do my best to maintain the extension.

Thank you!

Zoglun added a comment.Jan 7 2019, 8:49 AM

An error that we found is, when $wgUserEmailUseReplyTo = true; . the sender's email address were not listed in Reply-To filed. There for reply email sent from User B to User A will send to system mail. Instead of User B.

Is there anyway to fix this error?

For the error, I think I'll try to reproduce it and then attempt a fix. Could you file a (separate) issue/ticket describing (the problem) to MediaWiki-extensions-SparkPost? Also, can you make a patch adding yourself as co-author in extension.json? Thanks!

Ohh I see you've filed T213056 already!

Zoglun added a comment.Jan 7 2019, 9:41 AM

Ohh I see you've filed T213056 already!

I am not 100% sure that this is an error in SparkPost. Therefore I submit T213056 . Wish other developer could confirm the error location.

I am not 100% sure that this is an error in SparkPost. Therefore I submit T213056 . Wish other developer could confirm the error location.

That makes sense! Thanks a lot!

D3r1ck01 added a comment.EditedJan 9 2019, 6:52 PM

So @Zoglun, what is the way forward now? Will you be testing this on some production environment or so, after unit tests has been written?

D3r1ck01 closed this task as Resolved.Jan 9 2019, 6:55 PM

Main work on the extension itself is done. Will be moving to writing unit tests.