Coupon

Blocks ::: block_coupon
Maintained by Sebsoft BV, Rogier van Dongen
The Sebsoft Coupon Plugin offers you the possibility to create coupons for various levels of course access. Using a coupon code, users will be enrolled into courses that are attached to the coupon.
Latest release:
647 sites
431 downloads
105 fans
Current versions available: 5

SEBSOFT COUPON PLUGIN


The Sebsoft Coupon Plugin offers you the possibility to create coupons for various levels

of course access. Using a coupon code, users will be enrolled into courses that are attached to the coupon. That way, you can use the coupon system as voucher or vouchering system for your course(s).


There are a few different ways of generating coupons:

- Course level: this means one or more course(s) need to be selected for which the coupon is valid.

  Once the coupon code is entered by a user, he or she will be enroled in every course the coupon

  is attached to.

  A nice extra feature is, when groups are configured for a certain course, you can configure which

  course group the coupon is for. When a user claims the coupon, he or she will be added to that specific

  group in the course. This makes it possible to separate coupon users from regular users.

  You could also make specific course groups every time you generate a batch of new coupons, so there's

  some way of matching a batch of coupons to a group of users. The possibilities are numerous.


- Cohort level: this means one or more cohort(s) need to be selected for which the coupon is valid.

  Once the coupon code is entered by a user, he or she will be added as a cohort member for every

  cohort the coupon is attached to.

  NOTE: When generating cohort level coupons, there is a possibility to "connect" extra courses to

  a given cohort. One MUST know that upon doing this, the courses will at that point be added to

  the cohort enrolment sync. Without knowing this little fact, it could be "unexpected" behavior,

  even though it's a logical step.


Furthermore, coupons can be generated on two "access" levels:

- Personalized. The base of this, is either a CSV is uploaded, or a CSV is given directly in a textbox.

  The needed user information for every coupon to be generated will be the user's name, email address

  and gender.

  These coupons will then be generated and sent off to the appropriate users using a background task.


- Bulk: The base of this is simple: you generate a certain amount of access coupons, which will then

  be emailed to the pre-configured recipient or (if allowed) to an emailaddress that can be freely entered.


- WARNING:

  Wherever possible, please use PNG images.

  Also, whenever possible, do NOT use images that have an alpha channel.

  This will MASSIVELY slow down processing time, due to internal conversion of images by TCPDF.

  On our tests, for a 300 DPI image on A4 format (2480 x 3508 pixels) with an alpha channel,

  rendering a single PDF took around 25 seconds. Taking the alpha channel out of the image,

  rendering a single PDF was reduced to around 3 seconds.

  This means the PNG images should _always_ be stored as 24-bit true colour images.

  _Do not use 32-bit_ (true colour + transparency)!

  Furthermore, whenever possible, have the coupon generator create a single PDF with all

  coupons (this is only applicable when generating coupons in "bulk" mode). The process of

  generating coupons has been optimized to only "use" the image 1 time when creating any amount

  of coupons in a single PDF. If you choose the option to create a seperate PDF for every coupon,

  the image will have to be rendered for each and every PDF.

  This has 2 major downfalls:

  1. Every PDF will roughly have a slightly bigger size than the image size (in our tests, 350 - 400 kB per PDF)

  2. Every PDF takes the full amount of time to render.

  Effectively, this means the following (using fictitious sizes):

  10 coupons, single PDF -> result is around 400 kB, rendering takes around 3-4 seconds.

  10 coupons, seperate PDFs -> result is around 4 MB, rendering takes around 35-40 seconds.


INSTALLATION INSTRUCTIONS


- Copy the coupon folder to your blocks directory.

- Go to the moodle admin pages (you will probably be confronted with it anyway) and install the plugin

- Configure the main settings for the plugin.

- We're set up for usage!


PLACEMENT OF THE PLUGIN


There are only two pages you can add the coupon block on. This is the site's frontpage

or the user dashboard (my) page. The main reason for this is because the block is the

"frontend" for users to enter their coupon or voucher code.

Administrators and users with the correct capabilities will also see the links to

the coupon administration pages and the coupon generator page.


GENERAL CONSIDERATIONS


There's two main configurations to consider when generating coupons.

For course type coupons, this plugin attempts to enrol a user through use of Moodle's

internal function "enrol_try_internal_enrol".

The Moodle documentation shows it will attempt to enrol you using manual enrolment.

For this reason manual enrolment MUST be enabled for these courses.


For cohort type coupons, a user is made a member of a cohort. That's all there is to it.

Surprise though, if you want to actually make a user have access to a course, you

probably want to configure cohort enrolment for the course.


For those paying attention, creating cohort type coupons thus enables a simple

way of enrolling users into multiple courses at once just by configuring the right

cohort enrolments in multiple courses.

That's still not to say course coupons can't be used in a similar way (using meta courses).


Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6
Screenshot #7
Screenshot #8

Contributors

Sebsoft BV (Lead maintainer)
Rogier van Dongen
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Marcelle Geldenhuys
    Thu, 12 Jan 2023, 9:04 PM
    Hi Rogier

    This is an awesome plugin and very useful to as as we run multiple campaigns for our clients. Am I correct in my understanding that a single voucher with multiple uses cannot be generated at this stage? E.g. We want to run a campaign where we send an email to 5000 clients and say that the first 100 to use the same voucher code will be enrolled onto a course for free. If this is not an option at the moment, is this something you think may be implemented at some stage?
  • Rogier van Dongen
    Mon, 16 Jan 2023, 9:31 PM
    @Marcelle,
    You are correct in your understanding.
    It may be implemented at some later stage, but that may take a while (it's been requested multiple times but it'd involve a complete database overhaul so it's quite the job).
    Cheers
  • aziz vefa
    Sun, 19 Mar 2023, 12:01 PM
    Hi. We have multiple groups for a single course and each group has a non-editing teacher. We generate the coupons and deliver them to the teachers to deliver them to their students. Is it possible to allow the teachers to generate their own coupons or create enrollment links for their own students? They shouldn't see the other generated, used, or unused coupons. They should see used/unused coupons they created. Thank you.
  • Butrint Pllana
    Fri, 31 Mar 2023, 4:07 PM
    Hi there,
    Is it possible to enroll a course which has paypal attached with coupon? I'm trying to enroll a free course it works, but when it comes to purchase course, it won't work?
    Greetings!
  • Henrik sune Pedersen
    Tue, 2 May 2023, 6:12 PM
    Claimed by - col is empty after update to Moodle Workplace 4.1.1+ (Build: 20230130) (Moodle 4.1.1 (Build: 20230116)) - I have made an issue in the Bug tracker.
  • J. F.
    Tue, 2 May 2023, 10:34 PM
    We do have the same problem under 4.0.7 (Build: 20230401) - Added although on the tracker
  • Pascal Tielkens
    Mon, 5 June 2023, 10:18 PM
    Hi! Awesome plugin!
    When i generate the PDF files...I can scan the QR with my phone and immediatly create a new account and also enroll.

    Is there a way to add a LINK besides the QR so that laptop users do not have to scan the QR with their phone? The instructions only redirect to moodle login.
  • Rogier van Dongen
    Thu, 21 Dec 2023, 7:00 PM
    Hello all,
    Right before the holidays, there's a MASSIVE new release.
    Hopefully most important bugs were tackled, although focus was more on changing the configuration process as a result of adding PDF templating. This required us to redesign the configuration process of generating the coupons.

    Most important change: there's now a templating engine for the PDF's.
    This is also where one of our other plugins finally becomes very usefull (https://moodle.org/plugins/tool_tcpdffonts, which provides an interface for PDF font management).

    @pascal: there are more changes at hand for the coming year and we'll take this wish into account (among others: providing the QR and code in emails when applicable and the PDF options are not used).

    Also, we're working towards the concept of the much requested "campaigns" where one code serves _many_ users. Currently this is not possible due to the database structure, but we hope to add this next year.
    And if that wasn't enough, we're going to release a few plugins that rely on this one but makes life easier for administrators (and better be able to incorporate codes into the user signup process or places where a code can be entered/claimed)

    Cheers!
  • Christoph Mylaeus
    Thu, 21 Dec 2023, 9:43 PM
    I tried to install Version 4.3, but got an error: Fehler in der Kodierung gefunden, den nur Programmierer/innen korrigieren können: Incorrect syntax in plugin supported declaration in coupon. I am stuck, can't stop the upgrading process.
    Chris
  • Rogier van Dongen
    Thu, 21 Dec 2023, 9:48 PM
    Hello @Cristoph,
    Thanks you for pointing this out, we're instantly rolling out a new release, could take some 10 minutes to appear here.
    You should be able to upload this version over the other one. What strikes me is that my dev env (Moodle 4.2.3) did _not_ halt on this.

    Cheers
  • Christoph Mylaeus
    Thu, 21 Dec 2023, 10:32 PM
    Thanks. Problem solved. This time, it works. I have Moodle 4.3.1+ installed.
  • Rogier van Dongen
    Thu, 21 Dec 2023, 10:33 PM
    Glad it worked!
    Thank you again for addressing this one! With the holidays coming up this could have been a bit of a pain ;)

    Cheers!
  • Christoph Mylaeus
    Tue, 26 Dec 2023, 8:25 PM
    There is another problem in the new version: When redeeming a coupon, this error message appears after entering the code:
    Class "validator" not found.
    Thank you for taking care of solving this problem.
    Chris

  • Matt Metzgar
    Fri, 29 Dec 2023, 11:11 PM
    When I try to install the new version, I get the error message: xmldb_type_integer field "bodyformat" has invalid length
  • Christoph Mylaeus
    Thu, 4 Jan 2024, 4:51 PM
    Thanks for the next version build 20240102, which works for me. Happy new year!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Please login to post comments