Robin S

HannaCodeDialog

Recommended Posts

Robin S    2,487

I have had this module sitting in a 95% complete state for a while now and have finally made the push to get it out there. Thanks to @teppo for his Hanna Code Helper module which I referred to and borrowed from during development.

http://modules.processwire.com/modules/hanna-code-dialog/
https://github.com/Toutouwai/HannaCodeDialog

HannaCodeDialog

A module for ProcessWire CMS/CMF. Provides a number of enhancements for working with Hanna Code tags in CKEditor. The main enhancement is that Hanna tags in a CKEditor field may be double-clicked to edit their attributes using core ProcessWire inputfields in a modal dialog.

Requires the Hanna Code module.

Installation

Install the HannaCodeDialog module using any of the normal methods.

For any CKEditor field where you want the "Insert Hanna tag" dropdown menu to appear in the CKEditor toolbar, visit the field settings and add "HannaDropdown" to the "CKEditor Toolbar" settings field.

Module configuration

Visit the module configuration screen to set any of the following:

  • Exclude prefix: Hanna tags named with this prefix will not appear in the CKEditor toolbar dropdown menu for Hanna tag insertion.
  • Exclude Hanna tags: Hanna tags selected here will not appear in the CKEditor toolbar dropdown menu for Hanna tag insertion.
  • Background colour of tag widgets: you can customise the background colour used for Hanna tags in CKEditor if you like.
  • Dialog width: in pixels
  • Dialog height: in pixels

Features

Insert tag from toolbar dropdown menu

Place the cursor in the CKEditor window where you want to insert your Hanna tag, then select the tag from the "Insert Hanna tag" dropdown.

'Insert Hanna tag' dropdown

Advanced: if you want to control which tags appear in the dropdown on particular pages or templates you can hook HannaCodeDialog::getDropdownTags. See the forum support thread for examples .

Edit tag attributes in modal dialog

Insert a tag using the dropdown or double-click an existing tag in the CKEditor window to edit the tag attributes in a modal dialog.

Modal dialog

Tags are widgets

Hanna tags that have been inserted in a CKEditor window are "widgets" - they have a background colour for easy identification, are protected from accidental editing, and can be moved within the text by drag-and-drop.

Hanna tag widget

Options for tag attributes may be defined

You can define options for a tag attribute so that editors must choose an option rather than type text. This is useful for when only certain strings are valid for an attribute and also has the benefit of avoiding typos.

Add a new attribute for the Hanna tag, named the same as the existing attribute you want to add options for, followed by "__options". The options themselves are defined as a string, using a pipe character as a delimiter between options. Example for an existing attribute named "vegetables":

vegetables__options=Spinach|Pumpkin|Celery|Tomato|Brussels Sprout|Potato

You can define a default for an attribute as normal. Use a pipe delimiter if defining multiple options as the default, for example:

vegetables=Tomato|Potato

Dynamic options

Besides defining static options as above, you can use one Hanna tag to dynamically generate options for another. For instance, you could create a Hanna tag that generates options based on images that have been uploaded to the page, or the titles of children of the page.

Your Hanna tag that generates the options should echo a string of options delimited by pipe characters (i.e. the same format as a static options string).

You will probably want to name the Hanna tag that generates the options so that it starts with an underscore (or whatever prefix you have configured as the "exclude" prefix in the module config), to avoid it appearing as an insertable tag in the HannaCodeDialog dropdown menu.

Example for an existing attribute named "image":

image__options=[[_images_on_page]]

And the code for the _images_on_page tag:

<?php
$image_names = array();
$image_fields = $page->fields->find('type=FieldtypeImage')->explode('name');
foreach($image_fields as $image_field) {
    $image_names = array_unique( array_merge($image_names, $page->$image_field->explode('name') ) );
}
echo implode('|', $image_names);

Advanced: define or manipulate options in a hook

You can hook HannaCodeDialog::prepareOptions to define or manipulate options for a Hanna tag attribute. Your Hanna tag must include a someattribute__options attribute in order for the hook to fire. The prepareOptions method receives the following arguments that can be used in your hook:

  • options_string Any existing string of options you have set for the attribute
  • attribute_name The name of the attribute the options are for
  • tag_name The name of the Hanna tag
  • page The page being edited

If you hook after HannaCodeDialog::prepareOptions then your hook should set $event->return to an array of option values, or an associative array in the form of $value => $label.

Choice of inputfield for attribute

You can choose the inputfield that is used for an attribute in the dialog.

For text attributes the supported inputfields are text (this is the default inputfield for text attributes so it isn't necessary to specify it if you want it) and textarea. Note: any manual line breaks inside a textarea are removed because these will break the CKEditor tag widget.

Inputfields that support the selection of a single option are select (this is the default inputfield for attributes with options so it isn't necessary to specify it if you want it) and radios.

Inputfields that support the selection of multiple options are selectmultiple, asmselect and checkboxes.

You can also specify a checkbox inputfield - this is not for attributes with defined options but will limit an attribute to an integer value of 1 or 0.

The names of the inputfield types are case-insensitive.

Example for an existing attribute named "vegetables":

vegetables__type=asmselect

Descriptions and notes for inputfields

You can add a description or notes to an attribute and these will be displayed in the dialog.

Example for an existing attribute named "vegetables":

vegetables__description=Please select vegetables for your soup.
vegetables__notes=Pumpkin and celery is a delicious combination.

Notes

When creating or editing a Hanna tag you can view a basic cheatsheet outlining the HannaCodeDialog features relating to attributes below the "Attributes" config inputfield.

Troubleshooting

HannaCodeDialog includes and automatically loads the third-party CKEditor plugins Line Utilities and Widget. If you have added these plugins to your CKEditor field already for some purpose and experience problems with HannaCodeDialog try deactivating those plugins from the CKEditor field settings.

  • Like 18

Share this post


Link to post
Share on other sites
Ivan Gretsky    804

Great thing @Robin S! Something to make content creation even easier.

I see there is an option to exclude some Hanna codes from the list. What do you think about a whitelist option (preferably overridden on a template basis)?

 

  • Like 3

Share this post


Link to post
Share on other sites
Robin S    2,487
14 hours ago, Ivan Gretsky said:

What do you think about a whitelist option (preferably overridden on a template basis)?

In v0.0.2 I have added a hookable method that supplies the array of tag names for the dropdown menu. You can use an 'after' hook to control what appears in the dropdown. A couple of examples...

Define the tags for a given template:

$this->addHookAfter('HannaCodeDialog::getDropdownTags', function($event) {
    $page = $event->arguments('page');
    // Show only these tags on pages using the 'basic_page' template
    if($page->template == 'basic_page') {
        $event->return = ['some_tag', 'another_tag'];
    }
});

Remove certain tags for a given template:

$this->addHookAfter('HannaCodeDialog::getDropdownTags', function($event) {
    $page = $event->arguments('page');
    $tags = $event->return;
    // Remove these tags on pages using the 'basic_page' template
    if($page->template == 'basic_page') {
        $filtered_tags = array_filter($tags, function($tag) {
            return !in_array($tag, ['some_tag', 'another_tag']);
        });
        $event->return = array_values($filtered_tags);
    }
});

 

  • Like 2

Share this post


Link to post
Share on other sites
Macrura    2,142

it's working well so far... the only error i encountered was because the hanna code module config may not even be populated if you install hanna code and use the defaults, and never actually save the module, so one option would be to also check if the index for that module config is set, (around like 150 of the module)...

  • Like 1

Share this post


Link to post
Share on other sites
Robin S    2,487

Thanks for the report @Macrura, fixed with isset() now (no version change).

It bugs me a bit that PW doesn't save default values to the module config automatically in the module installation routine. Seems to me that is the whole point of defining a default - so some config value is present if nothing has been set manually.

Share this post


Link to post
Share on other sites
Macrura    2,142

it's a really amazing module, and will be indispensable for any site using hanna codes, i can already see this solving major problems with users entering incorrect stuff into their hanna codes. the options and description stuff is also amazing work!

  • Like 6

Share this post


Link to post
Share on other sites
tpr    2,213

Yep, I'm also thinking about adding an option to AOS for adding 3rd party ckeditor plugins because of such cool stuffs :)

Share this post


Link to post
Share on other sites
ottogal    110

Thank you, @Robin S, for this nice module. But I'm not sure I can use it for my special case.

To let my editor user embed a video from a internal page into a textarea (CKE), he would insert a HannaCode like this:

[[video source='LINK']]

Here the editor has to doubleclick the string LINK to select it, and click the "Link" Button of the CKE. The modal window "Insert Link" opens, and the user just needs to click "Select Page" to choose the page containing the wanted video in a field of type File. The HannaCode "video" itself would wrap the file data with the necessary code provided by the videoplayer script in use. This all works fine - even if I admit it's not very elegant.

After installing the HannaCodeDialog module, the string LINK appeares in the input field "source" of the dialog, of course. But there it's not possible to evoke the Insert Link action of the CKE. (And if there exist already some other calls of this HannaCode in the CKE-textarea, they also would become the functinoality of the module, and those LINKs were not editable anymore, too.)

So I ended in uninstalling the module. May be this could be solved by using some dynamic options - I didn't dive into these yet.

And of course, very likely my way to use HannaCode at all is a bit stupid, anyway...

Share this post


Link to post
Share on other sites
Robin S    2,487

@ottogal, you are right - this module will not cover your way of using HannaCode.

But if you only needed to select from videos uploaded to the current page instead of letting the editor choose another page (or alternatively from one page that contains all videos), you could adapt the approach I show in the first post for creating select options from images on the page.

Share this post


Link to post
Share on other sites
ottogal    110

Yes, I considered this. But indeed each video has to be fetched from it's own page (child of one page "video pool")...  ???

Share this post


Link to post
Share on other sites
Robin S    2,487
17 minutes ago, ottogal said:

But indeed each video has to be fetched from it's own page (child of one page "video pool")

If you have a "one video per page" setup then again you could dynamically generate options using another Hanna tag: get all children of "video pool" that have a video uploaded to them.

Share this post


Link to post
Share on other sites
Robin S    2,487

If people come up with any nifty usages of HannaCodeDialog it would be cool to get a bit of a library going in this thread.

Here's one to get the ball rolling.

Select FormBuilder form

For the foolproof selecting of a FormBuilder form to embed in a CKEditor field.

Import both of the export strings to use this. The code is shown here just for reference.

_formbuilder_forms

Export string (import this into Hanna Code):

!HannaCode:_formbuilder_forms:eyJuYW1lIjoiX2Zvcm1idWlsZGVyX2Zvcm1zIiwidHlwZSI6IjIiLCJjb2RlIjoiPD9waHBcbmVjaG8gaW1wbG9kZSgnfCcsIGl0ZXJhdG9yX3RvX2FycmF5KCRmb3Jtcy0+Z2V0SXRlcmF0b3IoKSkpOyJ9/!HannaCode

Code (just for reference):

<?php
echo implode('|', iterator_to_array($forms->getIterator()));

select_form

Export string (import this into Hanna Code):

!HannaCode:select_form:eyJuYW1lIjoic2VsZWN0X2Zvcm0iLCJ0eXBlIjoiMiIsImNvZGUiOiJcLypoY19hdHRyXG5mb3JtPVwiXCJcbmZvcm1fX29wdGlvbnM9XCJbW19mb3JtYnVpbGRlcl9mb3Jtc11dXCJcbmhjX2F0dHIqXC9cbjw/cGhwXG5pZigkZm9ybSkgZWNobyBcIjxwPmZvcm0tYnVpbGRlclwvJGZvcm08XC9wPlwiOyJ9/!HannaCode

Code (just for reference):

<?php
if($form) echo "<p>form-builder/$form</p>";

 

  • Like 4

Share this post


Link to post
Share on other sites
LMD    23

This module is just what I was looking for!

I'm using it to create links to a file download page, instead of to the file itself, with the 'dynamic options' method.

However, although it works perfectly, I'm getting a strange error in the Hanna dialogue modal window (see screenshot):

processwire_HannaCodeDialogue_error.png.4c1d8c79cfa35f04998895544cb16935.png

I have tried deleting the file compiler cache, but it did not resolve the issue.

Set-up Info:

  • Hanna Code: ver. 0.2.0
  • HannaCode Dialogue: ver. 0.0.3
  • ProcessWire: ver. 3.0.58
  • PHP: ver.  5.6.21

 

 

  • Like 3

Share this post


Link to post
Share on other sites

Hi,

after installing this plugin I get this error:

Notice: A non well formed numeric value encountered in /Applications/MAMP/htdocs/processwire/wire/core/Database.php on line 118
 

 

Bildschirmfoto 2017-04-10 um 12.45.40.png

Bildschirmfoto 2017-04-10 um 12.45.46.png

 

Set-up Info:

  • Hanna Code: ver. 0.2.0
  • HannaCode Dialogue: ver. 0.0.4
  • ProcessWire: ver. 3.0.59
  • PHP: ver.  7.0.0

Share this post


Link to post
Share on other sites
danielsl    2

Need some help

i installed hanna code-> created one short code

installed hanna code dialog-> but cant see any drop down dialog in page editor 

----------------------------------

use latest dev processwire

cant find any options for ckeditor, cant find it at all among modules,  read installation guide for hanna code dialog but it does not make any sense as no idea what to configure

Share this post


Link to post
Share on other sites
danielsl    2

cant set dialog working... installed the module

but it doesnt show up anywhere,

also no ckeditor in modules to edit...? but when i open body field i see the ckeditor toolbar(as i think)

--------------

latest dev, hanna code installed->one shortcode defined

Share this post


Link to post
Share on other sites
Robin S    2,487
12 hours ago, Andreas Augustin said:

after installing this plugin I get this error:

Notice: A non well formed numeric value encountered in /Applications/MAMP/htdocs/processwire/wire/core/Database.php on line 118

Thanks for the report. Are you running PHP 7.1? I think that's the version that started enforcing stricter numeric values and throwing errors like this.

I tested in PHP7.1 and I can't reproduce this issue. Also, I can't see how this error could be connected to HannaCodeDialog. From what I've read the "non well formed numeric value" error occurs when some arithmetic or other operation that expects an integer receives a string instead. And line 118 of Database.php is:

$timerTotalSinceStart = Debug::timer() - $timerFirstStartTime;

So probably Debug::timer() or $timerFirstStartTime is not an integer, but this is core code that relates to the debug mode tools and HannaCodeDialog has nothing to do with that.

Do you see the error as soon as you install HannaCodeDialog? Do you see it if you have no Hanna codes defined when the module is installed (I'm wondering if the problem is with one of your Hanna codes rather than the module itself)? If you uninstall HannaCodeDialog does the error go away?

 

12 hours ago, Andreas Augustin said:

Can I activate the Toolbar in CKEditor without choosing the Hanna Code Textformater and use the $hanna->render() API?

I will support this in the next version. The intention was to avoid needlessly attaching the plugins to every instance of CKEditor if the textformatter wasn't applied to that field, but I guess to support $hanna->render() there's no way to know if a CKEditor field needs the plugins or not.

 

1 hour ago, danielsl said:

cant set dialog working... installed the module

but it doesnt show up anywhere,

also no ckeditor in modules to edit...? but when i open body field i see the ckeditor toolbar(as i think)

I'm having trouble understanding exactly what's going wrong for you here. Make sure you meet the prerequisites and have completed the installation process:

  • TextformatterHannaCode must be installed.
  • TextformatterHannaCode must be applied as a textformatter to your CKEditor field.
  • You must have at least one Hanna code created.
  • Install HannaCodeDialog module.
  • Edit the settings for your CKEditor field and in "Input > CKEditor Settings > CKEditor Toolbar" add "HannaDropdown" (to be precise, with a comma space separating it from the other items there)
  • Like 1

Share this post


Link to post
Share on other sites
Robin S    2,487

v0.0.5 released. Allows use of the dropdown/dialog in CKEditor fields that do not have the Hanna Code textformatter applied to them, in order to support $hanna->render() usage.

  • Like 1

Share this post


Link to post
Share on other sites
tpr    2,213

I haven't tried this module so this request may be out of sync but how about adding items that wouldn't require Hanna code module? What I have in mind is having eg a

$config->hannaCodeDialogItems = array( item1 => function () { ... }, ... )

code somewhere in template files so one could easily insert custom items to ckeditor? Perhaps $config could be replaced with $page.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By bernhard
      hi everybody,
      this is a preview of a module that i'm working on for quite a long time. I needed it for an intranet office management application that i'm still working on. It makes it very easy to create very customized Datatables using the awesome jquery datatables plugin (www.datatables.net)
       
      EARLY ALPHA release!
      It's very likely that there will lots of changes to this module that may cause breaking your implementations.
       
      Module source
      sorry, removed as it changes too frequently; closed alpha - contact me if you think you can contribute
       
       
      Remarks:
      The module is intended to be used on the backend. Loading styles is at the moment only done via adding files to the $config->styles/scripts arrays. Also the communicaton to javascript is done via the $config->js() method that is built into the admin and would have to be implemented manually on frontend use. But it would not be difficult of course
      Installation:
      Nothing special here, just download + install
       
      edit: removed some parts, because i made a complete rewrite of the module! (see last posting in the thread)
       
      Customization example:
      in the screencast you see an example that i'm using in a process module. i put the table inside an InputfieldMarkup just to have the same look&feel all around the admin. you see that you could also use this module to create tables quickly and easily using @kongondo s runtime markup module.
      complete PHP code:
      $this->headline('Kundenliste'); $form = $modules->get('InputfieldForm'); // init datatables module $dt2 = $modules->get('RockDataTables2'); // setup columns // name $col = new dtCol(); $col->name = 'name'; $col->title = 'Name'; $col->data = function($page) { return $page->title; }; $dt2->cols->add($col); // type $col = new dtCol(); $col->name = 'type'; $col->data = function($page) { return $page->rockcontact_type->title; }; $dt2->cols->add($col); // modified $col = new dtCol(); $col->name = 'modified'; $col->data = function($page) { $obj = new stdClass(); $obj->timestamp = $page->modified; $obj->display = date('d.m.Y', $page->modified); return $obj; }; $dt2->cols->add($col); // setup table $dt2->id = 'dt_kundenliste'; $dt2->js('/site/modules/ProcessRockProjects/dt_kundenliste.js'); $f = $modules->get('InputfieldMarkup'); $f->value = $dt2->render(); $form->add($f); // ################################## // ajax request -> return data // non-ajax -> render form + table // ################################## if($config->ajax) { echo $dt2->getJSON($pages->find('template=rockcontact, sort=random, limit=10000')); die(); } else $out .= $form->render(); return $out; what is interesting here is this part:
      // modified $col = new dtCol(); $col->name = 'modified'; $col->data = function($page) { $obj = new stdClass(); $obj->timestamp = $page->modified; $obj->display = date('d.m.Y', $page->modified); return $obj; }; $dt2->cols->add($col); datatables support orthogonal data (https://datatables.net/extensions/buttons/examples/html5/outputFormat-orthogonal.html). a date column is a good example, because you need to DISPLAY a formatted date (like 10.02.2017) but you need to be able to SORT this column by a different value (timestamp). its very easy to accomplish this by providing both values in your json. Btw: You could also just transfer the timestamp and do the formatting on the client-side via javascript. Next Example will show ho this would work. Both cases can be necessary, it's just an example here.
      [...] removed
      Why i created this module:
      of course i know @Soma s module but i needed a lot more features and the newer datatables version. also i like to define all the columns as objects and have everything on one place. lister & markupadmindatatable: nice for basic tables but lacks of features to modify the appearance of the cell values (like rendering icons, background colors and so on) datatables provides a great frontend API for filtering, showing/hiding columns, getting data, modifying it... it also plays well together with frontend charts like google chart api in this case:
       
      todo / roadmap:
      all kinds of column filters (like seen in the example above that shows an older and bloated version of this module) support for ajax filters and pagination (currently all filtering and sorting is done on the client side. i tried it with up to 50.000 rows and got reasonable results. initial loading took around 10sec. but of course this heavily depends on the complexity of your table and your data.  
       
       
    • By Robin S
      PageListTrash
      Allows non-superusers to trash pages directly from Page List (if they have page-delete permission for that page).
      Not much to say really - the module adds a "Trash" option to the extra actions for pages in Page List. It looks and works just like the Trash action available to superusers.

      https://github.com/Toutouwai/PageListTrash/
       
      Up to you whether you think non-superusers should be trusted with simpler trashing. For most cases I like the default behaviour where editors have to jump through some more hoops - I want them to think carefully about what they are doing. But if an editor needs to trash several pages then this module might reduce frustration.
      @tpr, by now you can probably predict what I'm going to say...
      ...something to merge into AdminOnSteroids?
    • By horst
      Wire Mail SMTP

      An extension to the new WireMail base class that uses SMTP-transport

      This module integrates EmailMessage, SMTP and SASL php-libraries from Manuel Lemos into ProcessWire. I use this continously evolved libraries for about 10 years now and there was never a reason or occasion not to do so. I use it nearly every day in my office for automated composing and sending personalized messages with attachments, requests for Disposition Notifications, etc. Also I have used it for sending personalized Bulkmails many times.

      The WireMailSmtp module extends the new email-related WireMail base class introduced in ProcessWire 2.4.1 (while this writing, the dev-branch only).
       
      Here are Ryans announcement.



      Current Version 0.2.5
      get it from the Modules Directory Install and Configure

      Download the module into your site/modules/ directory and install it.

      In the config page you fill in settings for the SMTP server and optionaly the (default) sender, like email address, name and signature.
      You can test the smtp settings directly there. If it says "SUCCESS! SMTP settings appear to work correctly." you are ready to start using it in templates, modules or bootstrap scripts.


      Usage Examples
      The simplest way to use it:
      $numSent = wireMail($to, $from, $subject, $textBody); $numSent = wireMail($to, '', $subject, $textBody); // or with a default sender emailaddress on config page This will send a plain text message to each recipient.
       
      You may also use the object oriented style:
      $mail = wireMail(); // calling an empty wireMail() returns a wireMail object $mail->to($toEmail, $toName); $mail->from = $yourEmailaddress; // if you don't have set a default sender in config // or if you want to override that $mail->subject($subject); $mail->body($textBody); $numSent = $mail->send(); Or chained, like everywhere in ProcessWire:
      $mail = wireMail(); $numSent = $mail->to($toEmail)->subject($subject)->body($textBody)->send(); Additionaly to the basics there are more options available with WireMailSmtp. The main difference compared to the WireMail BaseClass is the sendSingle option. With it you can set only one To-Recipient but additional CC-Recipients.
      $mail = wireMail(); $mail->sendSingle(true)->to($toEmail, $toName)->cc(array('person1@example.com', 'person2@example.com', 'person3@example.com')); $numSent = $mail->subject($subject)->body($textBody)->send(); The same as function call with options array:
      $options = array( 'sendSingle' => true, 'cc' => array('person1@example.com', 'person2@example.com', 'person3@example.com') ); $numSent = wireMail($to, '', $subject, $textBody, $options); There are methods to your disposal to check if you have the right WireMail-Class and if the SMTP-settings are working:
      $mail = wireMail(); if($mail->className != 'WireMailSmtp') { // Uups, wrong WireMail-Class: do something to inform the user and quit echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; return; } if(!$mail->testConnection()) { // Connection not working: echo "<p>Couldn't connect to the SMTP server. Please check the {$mail->className} modules config settings!</p>"; return; } Following are a ...


      List of all options and features


      testConnection () - returns true on success, false on failures


      sendSingle ( true | false ) - default is false

      sendBulk ( true | false ) - default is false, Set this to true if you have lots of recipients (50+)


      to ($recipients) - one emailaddress or array with multiple emailaddresses

      cc ($recipients) - only available with mode sendSingle, one emailaddress or array with multiple emailaddresses

      bcc ($recipients) - one emailaddress or array with multiple emailaddresses

       
      from = 'person@example.com' - emailaddress, can be set in module config (called Sender Emailaddress) but it can be overwritten here

      fromName = 'Name Surname' - optional, can be set in module config (called Sender Name) but it can be overwritten here


      priority (3) - 1 = Highest | 2 = High | 3 = Normal | 4 = Low | 5 = Lowest

      dispositionNotification () or notification () - request a Disposition Notification


      subject ($subject) - subject of the message

      body ($textBody) - use this one alone to create and send plainText emailmessages

      bodyHTML ($htmlBody) - use this to create a Multipart Alternative Emailmessage (containing a HTML-Part and a Plaintext-Part as fallback)

      addSignature ( true | false ) - the default-behave is selectable in config screen, this can be overridden here
      (only available if a signature is defined in the config screen)

      attachment ($filename, $alternativeBasename = "") - add attachment file, optionally alternative basename


      send () - send the message(s) and return number of successful sent messages


      getResult () - returns a dump (array) with all recipients (to, cc, bcc) and settings you have selected with the message, the message subject and body, and lists of successfull addresses and failed addresses,


      logActivity ($logmessage) - you may log success if you want

      logError ($logmessage) - you may log warnings, too. - Errors are logged automaticaly
       
       
      useSentLog (true | false) - intended for usage with e.g. third party newsletter modules - tells the send() method to make usage of the sentLog-methods - the following three sentLog methods are hookable, e.g. if you don't want log into files you may provide your own storage, or add additional functionality here

      sentLogReset ()  - starts a new LogSession - Best usage would be interactively once when setting up a new Newsletter

      sentLogGet ()  - is called automaticly within the send() method - returns an array containing all previously used emailaddresses

      sentLogAdd ($emailaddress)  - is called automaticly within the send() method
       
      Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md
       
    • By celfred
      Hello,
      I'm desperately trying to update my website to PW 3.0.62 and I'm facing issues to to module compatibility. I was stuck with Pages2Pdf which I managed to solve bu updating the module from Github, but now it's the Pages Web Service module... and this time, I don't know wht to do
      The Module is found there. But it is quite old and I can't find it in the modules catalogue... and my site is making quite a use of it (I can't think of a way to do otherwise, sorry...)
      After adding the FileCompiler=0 to the module pages, the error I'm stuck with is :
      Fatal error: Class 'WireData' not found in /home/celfred/PlanetAlert/site/modules/ServicePages/ServicePages.module on line 22
      and I have no idea on what to do... I must admit I'm not a programmer but a middle-school teacher... (for your information, here's the site I'm talking about : http://planetalert.tuxfamily.org ) but I'm struggling hard to solve the different issues I have to face and I'm wlling to understand things. I have just spent many hours trying to make 2.8 work on my localhost (and it seems ok ) but I'd like to switch to 3.x to prepare the future
      If anyone had the will to spend a few minutes to try and help me, I would greatly appreciate.
      Thanks in advance !
      If you need more information to understand my problem, feel free to ask.
    • By dimitrios
      Hello,
      I have created a module that, given a Facebook app ID and secret, posts on Facebook on behalf of a user profile or page after a PW page is saved.
      This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates On/Off switch: specify a checkbox field that will not allow the post if checked Specify a message and/or an image for the post
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, a token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is used.