Extension talk:EmailPage

(Redirected from Extension talk:EmailArticle)
Latest comment: 8 months ago by Kghbln in topic Could not instantiate mail function.

Fill wgEmailPageContactsCat with a valid category doesn't show a drop-down list

edit

The category contains subcategory that contains page with email adress

Thanks

Sorry, I did not see this before. See this section. Basically this configuration parameter is gone. --[[kgh]] (talk) 18:23, 9 April 2016 (UTC)Reply

PHPMailer class not found!

edit

The current download bundle doesn't seem to work, I get this error

PHPMailer class not found!

I tried setting

$wgPhpMailerClass = "$IP/extensions/EmailPage/PHPMailer_5.2.4/class.phpmailer.php";

Also linked PHPMailer_5.2.4 to phpmailer in the extension dir and copyed it to /usr/share/php. I'm also seeing this in my apache error log

PHP Notice:  Undefined variable: dir in /home/txeng/mediawiki-1.26.0/extensions/EmailPage/EmailPage_body.php on line 13

Thanks. --Kc5vcx (talk) 03:26, 12 December 2015 (UTC)Reply

Sorry, I did not see this before. This issue was reported and fixed at GitHub. You should give the new version 2.4.1 an shot. Cheers --[[kgh]] (talk) 18:26, 9 April 2016 (UTC)Reply
The project has moved to GitLab and this GitHub issue no longer exists on the InterWebs, but I assume that it's a similar issue to the one mentioned below, in that you need to cd extensions/EmailPage; composer install in order for the extension to have its own copy of PHPMailer, unless it's installed globally at your site. --Ernstkm (talk) 06:33, 10 August 2021 (UTC)Reply

Can't seem to get $wgEmailPageContactsCat to work

edit

Hi, I have been experimenting with this extension and I have managed to get it to work and send emails, but I do not seem to be able to get the $wgEmailPageContactsCat option to work. I am using version 2.4.1, 2016-04-07

I have had a look at the code and I can see how the email page is built, but the page does not seem to be doing anything with $wgEmailPageContactsCat that I have noticed so I am not sure how to debug the process.

What format should the value be?

  • $wgEmailPageContactsCat = 'Catname'; OR
  • $wgEmailPageContactsCat = 'Catergory:Catname'; OR
  • $wgEmailPageContactsCat = '[[Catergory:Catname]]';

When it comes to the subcategories do they only appear if the pages belonging to the subcategory have emails defined? Should this process be able to work with "User:username" pages that are added to the subcategory? Does the email value have to be defined in a template using {{{email}}} or does it just parse the first email address on the page?

Also, when emailing a page, is it possible to just email a linkable title instead of the full page?

This option could be very useful for one of my current projects so it would be great to know.

Thanks --Jpadfield (talk) 17:53, 9 April 2016 (UTC)Reply

I did not know that this configuration parameter existed. Well, it is indeed in the docu but I just looked at the code and saw that this parameter is no longer there, so it will not work in any case. Cannot tell why and when this was removed though. Cheers --[[kgh]] (talk) 18:01, 9 April 2016 (UTC)Reply
Thanks for letting me know, it would have been useful, I will now explore using the API to create new user groups instead. --Jpadfield (talk) 21:16, 9 April 2016 (UTC)Reply
Just to say, in case it is of use, if one is using Semantic Mediawiki it is possible to add email from pages listed under a category using an inline "ask" query, a bit like the code below, added to the send function in SpecialEmailPage.php, instead of the section that adds user emails from the media wiki groups. Where "Mbox" is the property for the email addresses:
  $ot = $wgParser->parse("{{#ask: [[Category:".$this->group."]]|?Mbox=|mainlabel=-|limit=300|link=none|searchlabel=}}",
   Title::newFromText('Email List'), new ParserOptions());
  $test = strip_tags($ot->getText());
  $elist = explode(",", $test);
  foreach ($elist as $k => $v)
    {$this->addRecipient( trim($v) );}
To Make the drop down in the first place I also added the following code to the execute function in SpecialEmailPage.php, instead of the section that creates the wiki group drop down. The getCategories function is just a simple list at the moment as I have not worked out how to list subcategories without calling the API.
  $groups = "<option />";
  $cats = $this->getCategories ();
  foreach ($cats as $k => $group)
    {
    $selected = $group == $this->group ? ' selected' : '';
    $groups .= "<option$selected>$group</option>";
    }

--Jpadfield (talk) 12:55, 11 April 2016 (UTC)Reply

PHPMailer security issue CVE-2016-10033

edit

Exploits are in the wild for this security issue with PHPMailer. PHPMailer 5.2.18 resolves the issue. -71.36.99.196 00:37, 28 December 2016 (UTC)Reply

Thanks a lot for notifying! Aran has released a new version of this extension this day. However an new critical is around so we need another release soon. --[[kgh]] (talk) 19:03, 3 January 2017 (UTC) Edit: reported hereReply

#info: code not rendering in html emails

edit

Hi.. Great extension, thank you!

I am using version 2.4.4, 2017-04-26 of this extension ith my MW-1.28.2..

I use the #info: tag extensively in many pages I wish to be emailed by users.. as it is now, these info tags get decomposed as inline text. Is there an easy way to allow them to be emailed as clickable info bubbles as they are in my pages?

For example, in tables, I have a column called "Title" where the content of the rows in that column are all of the patern:

...
|-
|TitleID
|Some Short Title {{#info: A very lengthy and wordy description... }}
|Other Data
|-
...

and in the email, it gets rendered as if I coded it like this:

...
|-
|TitleID
|Some Short Title A very lengthy and wordy description... 
|Other Data
|-
...

as you can see, the info tag wrapper has been removed. -User:revansx

You should mention that the #info parser function is provided by Semantic MediaWiki. This parser function was overhauled for the upcoming version 3.0.0. I will install this extension on sandbox smw to allow testing if there is also an issue with it now. Cheers --[[kgh]] (talk) 15:20, 11 December 2017 (UTC)Reply
As reality has it there was another issue which I had to address on the server before testing this. The test shows that also in SMW the "info" parser function is changed to plain text representation in html. Admittedly I only use this extension for basic pages without any fancy stuff on it. Thus I did not encounter this issue. However, the elements rendered by "info" have deticated classes so it should be possible to do display none for them via a CSS page just for sending out content. Cheers --[[kgh]] (talk) 23:20, 12 December 2017 (UTC)Reply
Gotcha. Continued thanks! .. any chance you can help me understand the CSS part better? I installed this extension and there doesn't seem to be *any* CSS making its way to the emailed html.. not even the most basic "wikitable" class formatting. Please see the topic below this one. thanks! --User:revansx

Guidance on CSS

edit

Love this extension and I'm sorry to have to ask such a simple question, but as installed, my class="wikitable" css for tables is not finding it's way to the emailed html. Is this the way it is supposed to be? or is this indicative of an issue on my particular implementation? .. either way, please help me understand what I should do to get my default "Mediawiki:Common.css" CSS included with the emailing. Thanks! ~ User:revansx

Set up PHPMailer

edit

Hi, I'm sitting here for hours but either there's an error or it says my mail would have been send, even though I don't receive anything. I would like to use an external Mailserver with SMTP(no localhost), but I don't know how to set up PHPMailer. Using PHPMailer-5.2.23 or PHPMailer-6.0.5, where do I have to configure my mailsettings? Thanks a lot!

Show all recipients in the to: field?

edit

Is there a way to have all the recipients of one of these emails shown in the to: field of the email? Would be extremely helpful in our application. Or is this a PHPMailer question? Thanks! - Lbillett (talk) 20:32, 14 December 2018 (UTC)Reply

I would like to know this too. Thanks. - Rich (User:revansx)

Does not email talk pages or topics when using Flow

edit
  • Mediawiki - 1.30.0 (830bb58) 16:58, 8 December 2017
  • Echo = – (d64a26d) 15:29, 23 August 2018
  • Flow - 1.1 (aac80e7) 17:11, 7 January 2019
  • EmailPage - 2.4.4, 2017-04-26

Attempts to email a Talk page or a specific topic permathread result in only the GUID of the topic being sent by email.

What are the author's/owner's thoughts on EmailPage supporting the Flow extension?

Thanks! /Rich (User:revansx)

Force inclusion of the page url in the email

edit

If you have enabled magicwords;

To include a link to the article in the email sent.

edit SpecialEmailPage.php 
change var $message; to var $message = '<small>{{fullurl:{{PAGENAME}}}}</small>'; on line 7
and comment out $this->message = $wgRequest->getText( 'ea-message' ); on line 37

External Image from Widget not being emailed

edit

Hi. I use EmailPage (2.4.4, 2017-04-26) on my private enterprise mediawiki site (1.30.0, 830bb58).

The emails send in html with all image references referencing the images used in the page pointing back to the firewall'ed server which is not accessible to many people who are not VPN'ed in to the enterprise network when they read the email. This is ok for most content (which should indeed be kept protected), but one specific problem I'd like to solve is how to include the company logo (an image file which is available on the company's public website) on a general page I send out periodically.

I thought I was clever by creating a widget using the Widgets extension (1.3.0, 72d1e24) to embed an pre-defined external image into a wiki page using the code {{#widget:ShowLogo}} (using the Widget code below). It works on the wiki page itself. The external image displays perfectly in the wiki.. however it does not get sent as part of the page when I use EmailPage to send the page to people.

What am I missing? Thanks!

/Rich

Wiki text for page "Widget:ShowLogo"

<script type="text/javascript">
document.write('<img src=https://www.example.com/logo.png>' );
</script>

Had to manually run composer in the EmailPage directory to get PHPMailer

edit

Had to run composer install --no-dev in the extensions/EmailPage directory to get PHPMailer installed in the extensions directory as the extension expects.

After composer ran I had to:

  • chown -R apache:apache /opt/htdocs/mediawiki/extensions/EmailPage
  • chmod -R 775 /opt/htdocs/mediawiki/extensions/EmailPage

On my enterprise RedHat system I may have also be running into an SELinux issue preventing PHP or the web server from sending email. I ran:

  • getsebool httpd_can_sendmail
  • getsebool httpd_can_network_connect

and both commands responded with "off" so I ran:

  • sudo setsebool -P httpd_can_sendmail 1
  • sudo setsebool -P httpd_can_network_connect 1

just to be sure.

I ran into the same problem (not so much the permissions and SELinux stuff, but the composer install stuff), so the installation instructions have been updated to note this. --Ernstkm (talk) 06:29, 10 August 2021 (UTC)Reply

504 Gateway Time-out - The server didn't respond in time.

edit

Installation seems to be correct. Followed all the instructions. Everything seems fine right up until I click "submit" on the send email page and then it hangs.. and after about 30 seconds I get a blank white screen with the simple message " 504 Gateway Time-out - The server didn't respond in time."

  • MW 1.34.1
  • PHP 7.2.30 (apache2handler)
  • EmailPage 2.5.0, 2020-02-05 (5a60dfd) 09:50, 6 April 2020
  • phpmailer/phpmailer 6.1.5

The regular Special:EmailUser page works fine.

edit

When I click on Special:EmailPage, there is only this message.

There wasn't any sidebar for me to choose from. Is this a known issue? Or perhaps a configuration issue?

MW 1.38.2

PHP 8.0.22

EmailPage 2.5.1 Ay2014 (talk) 07:37, 6 February 2023 (UTC)Reply

Could not instantiate mail function.

edit
Issue

When trying to send a page I get:

Error sending Page: Couldn't send to hello@example.org: Could not instantiate mail function.

Setup
  • MediaWiki 1.35.9 (adff703) 20:01, 1 March 2023
  • EmailPage 2.5.1, 2021-02-13 (edf9216) 21:59, 13 February 2021
  • phpmailer/phpmailer 6.7.1
  • PHP 7.3.31-1~deb10u3 (apache2handler)

I am using a relay (AWS SES) correctly configured with $wgSMTP. Tested by sending emails to users via interface, etc.

[[kgh]] (talk) 12:13, 4 March 2023 (UTC)Reply

Use the updated code availabel at the new GitHub repo. --[[kgh]] (talk) 19:24, 13 March 2024 (UTC)Reply

undefined method User::getEffectiveGroups()

edit

Hi!

I'm trying to use extension on MW 1.39.4 and get the error:

Error: Call to undefined method User::getEffectiveGroups()

Backtrace:

from /var/www/html/last_of_us/extensions/EmailPage/EmailPage_body.php(54) Derek Jones Smr (talk) 09:27, 19 December 2023 (UTC)Reply

This was reported with GitHub issue 6. A fix is available. See the issue comments. --[[kgh]] (talk) 19:23, 13 March 2024 (UTC)Reply
Return to "EmailPage" page.