Coder Social home page Coder Social logo

sgladstone / com.pogstone.fancytokens Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 17.0 92 KB

CiviCRM extension that provides tokens for events, contribution pages, greetings, profiles and forms. Tokens can be used in emails and letters.

License: Other

PHP 84.69% Smarty 15.31%

com.pogstone.fancytokens's People

Contributors

colemanw avatar jboiss avatar kainuk avatar megaphonejon avatar rajeshvedaconsulting avatar sgladstone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

com.pogstone.fancytokens's Issues

Fatal error Undefined constant "spouse_last_name" in php 8

Fatal error when using casual greeting in Smarty.
I followed the stacktrace and found unsupported syntax at line 443 of utils/GreetingHelper.php
adding single quotes resolves the issue. I'd create a pull request, but I'm afraid I don't know how to do that.

Tag the new release?

Hi Sarah,

I noticed that the extension directory wasn't showing version 3.6, so I looked into why. The release isn't tagged in git.

If you've got your master branch checked out on your computer, you can just do:

git tag 3.6
git push origin 3.6

Thanks!
Jon

Release for 4.6?

Very little has changed in CiviCRM 4.5 to 4.6 wrt tokens, so I suspect you could just tag and release a 4.6-compatible version without any updates (but haven't tried it myself).

Limited to last 15 tokens for Event Registrations

I had an issue where a client was sending out emails to event registration pages where the link was missing, even though they added the event ID to the token.
After looking at the code, it appears that there is a "LIMIT 15" clause in the SQL which limits tokens to the last 15 events by event date. I'm not sure if this project is still active, but I have added this comment in case anyone else runs into this problem.

Profile form token URL label should use public-facing profile name

Right now when I insert a token for a profile form, the clickable text that's used is the internal profile name. Where available, I think it should instead use the public-facing profile name.

Screenshot of the profile management form:

Screen Shot 2021-04-07 at 16 22 13

Screenshot of the resulting email with token {communitynews.standaloneprofile___16}:

Screen Shot 2021-04-07 at 16 22 47

I think the related logic may be at

$label = $cur['title'].' (id: '.$cur['id'].') :: Forms';

Tokens for registration pages not resolving if event is not public

Tokens are available in the token list for upcoming events that are not Public. This makes sense to me.

However, those tokens are blank, which is not the expected result.

There are two possible approaches:

  • Simply don't make non-Public events available in the token list. I don't prefer this, as there are many reasons one might want to send emails to register for an event while not having that event listed publicly.

  • Make these tokens resolve as expected.

Checksum expiration date

Hi Sarah,
I have been playing to get a checksum expiration date 'token' working through smarty.
I did not succeed. But maybe it would be easy for you to create a token with:
the current date + the checksum lifespan.
So in emails to edit a profile we can use something like:
You can use the links in this email to edit your data until September 20th.
Maybe it's harder than I think to create, but maybe it's a 5 minute thing for you :-)

Communitynews token for 37 days

Hey there,

I want to shedule a mail being sent every 30 days/once a month to remind my users for upcoming events next month and I plan to do this with civirules.

Problem:
However, communitynews token with 30 days isn't enough, because then there are events with 32 days in upcoming, this means:

  1. The event is too far away for the last reminder
  2. When the new reminder triggers, the event is already just in two days.

Solution:
An 37 day upcoming token would give me some overlapping

Tokens not selectable in civicrm 4.5 drupal 7.3.4

Hello Sarah, For the last months we experience a problem with the fancytokens extension on civicrm 4.5. When we activate it, the token selector blanks out (see attached screenshot). Do you have a clue on how we can get it working? We've grown fond of it :)
civicrm_fancytokens_problem

Replace SSL code with internal calls

Hi Sarah,

Thanks for a new version of your excellent extension!

I was just reviewing the code as part of my maintenance contract for a client, and I saw that you call $_SERVER['HTTPS'] to determine if HTTPS is in use.

However, this only determines if the current user is using SSL, not if SSL is the preferred protocol. Instead, I think you can replace a whole lot of that code with a call to CRM_Core_Config::singleton()->userSystem->getAbsoluteBaseURL().

Since that code is Drupal-specific, you might even get away with a Drupal-specific call to url() but I suspect that would break on D8, whereas this approach would work for any non-CiviCRM URL on the site. I think it'll also help with multi-site edge cases.

Fatal error for PHP8

Got error 'PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in [*********httpdocs/backdrop/files/civicrm/ext/com.pogstone.fancytokens/fancytokens.civix.php] on line 149'
Common Civix error for PHP8

Formal tokens making wrong assumptions about gender

When a contact in a spousal relationship does not have a specified gender or prefix, the gender is assumed to be male: {greetings.joint_formal} and {greetings.joint_formal_firstname} resolve to "Mr. and Mr. LastName" and "Mr. First Last and Mr. First Last".

In a world of gender complexity, I'd suggest that if a token encounters no explicit gender cues, that it resolve instead to FirstName LastName. At the very least, the README should explicitly describe this limitation and indicate that to use the formal greeting tokens the dataset must include gender or prefix.

tpl override breaks Civi 4.5

The overridden templates/CRM/Mailing/Form/InsertTokens.tpl would need updating for 4.5. Or if at all possible I would recommend removing it completely, as the token insert ui is much nicer in 4.5 anyway and probably whatever you were tweaking with the tpl override has been fixed already.

Casual Joint Greeting Tokens not evaluating gender

When using Formal joint tokens (those that include the individual prefix), the gender is evaluated to put the male first in the greeting (i.e. Mr. & Mrs. Smith). However, Casual joint tokens (those that exclude the individual prefix) put contact_a of the relationship as the first in the greeting regardless of the contact's gender or title. The only workaround is to delete the relationships where the husband is contact_b and recreate them.

Ideally, all joint tokens should evaluate the gender in order to put the male first.
As far as I can tell, it should be pretty straightforward to fix this by simply copying the conditionals used in formal joint greeting tokens to the casual joint greeting tokens.
Happy to chip in for a fix

Here are some screenshots from some tests I ran.

screen shot 2017-12-10 at 1 25 05 pm

screen shot 2017-12-10 at 1 24 16 pm

screen shot 2017-12-10 at 1 29 12 pm

screen shot 2017-12-10 at 1 27 40 pm

PHP error: "Call to undefined function" module_exists( "webform_civicrm")

On 4.6.7 I get error in /modules/civicrm/extern/error_log

PHP Fatal error: Call to undefined function module_exists() in /civicrm/extensions/com.pogstone.fancytokens-master/fancytokens.php on line 103

Scope issue with drupal API Also strange statement no?
if( module_exists( "webform_civicrm") && module_exists( "webform_civicrm"))

Current maintainer?

Just wondering if the current maintainer is still Sarah given the sale of Pogstone.

Communitynews for not public events

Hey there,

my setting is in #24. For my sheduled reminders I not only want to send public, but also "internal" events.

If I see it correctly, communitynews.upcomingevents___day_30 sends only public events?!

Is there a chance you make a flavour with all events, which is also non public.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.