Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New Subscription form should pre-populate name/email fields when possible #204

Closed
raamdev opened this issue Jan 11, 2016 · 4 comments
Closed

Comments

@raamdev
Copy link
Contributor

raamdev commented Jan 11, 2016

When Subscribing Without Commenting, the Add New Subscription form should pre-populate the Name and Email address fields when possible (i.e., when a cookie exists from previously leaving a comment, or when the user is logged in):

2016-01-11_10-49-18

2016-01-11_10-49-37


This was pointed out by @RealDavidoff here: #199 (comment)

@jaswrks
Copy link

jaswrks commented Jan 25, 2016

Next Actions

  • New feature branch in the websharks/comment-mail-pro repo.

  • After this line add the following:

    if(!$this->is_edit && !static::$processing && in_array($key_prop, array('fname', 'lname', 'email'), TRUE)) {
        // We can try to autofill fname, lname, email for new subscriptions.
        $current = wp_get_current_commenter();
    
        switch($key_prop) {
            case 'fname':
                if(!empty($current['comment_author'])) {
                    return $this->plugin->utils_string->first_name((string)$current['comment_author']);
                }
                break;
    
            case 'lname':
                if(!empty($current['comment_author'])) {
                    return $this->plugin->utils_string->last_name((string)$current['comment_author']);
                }
                break;
    
            case 'email':
                if(!empty($current['comment_author_email'])) {
                    return (string)$current['comment_author_email'];
                }
                break;
        }
    }
    if(!$this->is_edit && !static::$processing && in_array($key_prop, array('fname', 'lname', 'email'), TRUE)) {
        // We can try to autofill fname, lname, email for new subscriptions.
        $current = wp_get_current_user();
    
        switch($key_prop) {
            case 'fname':
                if(!empty($current->first_name)) {
                    return $this->plugin->utils_string->first_name((string)$current->first_name);
                }
                break;
    
            case 'lname':
                if(!empty($current->last_name)) {
                    return $this->plugin->utils_string->last_name((string)$current->last_name);
                }
                break;
    
            case 'email':
                if(!empty($current->email)) {
                    return (string)$current->email;
                }
                break;
        }
    }
  • Submit PR for review.


  • Repeat in Lite version of the software also.

kristineds pushed a commit to wpsharks/comment-mail-pro that referenced this issue Jan 25, 2016
jaswrks pushed a commit to wpsharks/comment-mail-pro that referenced this issue Feb 2, 2016
kristineds pushed a commit to wpsharks/comment-mail-pro that referenced this issue Feb 4, 2016
kristineds pushed a commit that referenced this issue Feb 4, 2016
@raamdev
Copy link
Contributor Author

raamdev commented Feb 6, 2016

Next Lite Release Changelog:

  • Enhancement: When Subscribing Without Commenting, the Add New Subscription form now pre-populates the Name and Email address fields whenever possible. Props @kristineds. See Issue #204.

@raamdev
Copy link
Contributor Author

raamdev commented Feb 6, 2016

Next Pro Release Changelog:

  • Enhancement: When Subscribing Without Commenting, the Add New Subscription form now pre-populates the Name and Email address fields whenever possible. Props @kristineds. See Issue #204.

@raamdev raamdev closed this as completed Feb 6, 2016
raamdev added a commit that referenced this issue Jun 18, 2016
- **Restructured Codebase**: The codebase has been completely restructured to improve performance, enhance flexibility, and make it easier to build in new features! Props @jaswsinc. See [Issue #150](#150).
- **Comment Mail Pro Upgrade Notice: Incompatible Advanced Templates.** This version of Comment Mail includes a rewritten and improved codebase. This rewrite, however, came with the unfortunate side effect of breaking backwards compatibility with Advanced Templates that were customized in a previous version of Comment Mail Pro.

     If you are currently using Comment Mail Pro and you've customized your Advanced Templates, all of your customized Advanced Templates will be backed up and the templates will then be reset to their new defaults. You will find the backup of your old customized template appended to the bottom of the new template, separated with a  <code>Legacy Template Backup</code> PHP comment. See [example screenshots](#238 (comment)).

     Note: This change has no effect on Simple templates—only Advanced Templates are affected. Advanced Templates are a Pro-only feature, so this notice only applies to Comment Mail Pro. See [Issue #238](#238).
- **Bug Fix**: Fixed a bug where `esc_html()` was being used where `esc_sql()` should've been used. Props @jaswsinc @kristineds. See [Issue #268](#268).
- **Bug Fix**: Fixed a bug that in some scenarios resulted in a "DB table creation failure" error when activating the plugin. Props @thienhaxanh2405, @PanNovak, @kristineds, and @jaswsinc. See [Issue #260](#260).
- **Bug Fix**: Fixed a bug where "New reply" notification emails were not being parsed properly by some Hotmail accounts and were showing up as blank. Props @kristineds. See [Issue #259](#259).
- **Bug Fix**: Fixed a bug that allowed spam comments to create subscriptions in Comment Mail when using Akismet. Props @IvanRF. See [Issue #250](#250).
- **Bug Fix** (Pro): When Chrome or Firefox Autofill Username/Password was enabled, the Comment Mail Pro Updater fields would incorrectly be autofilled by the browser with invalid credentials. This has been fixed. Props @renzms. [Issue #274](#274).
- **Bug Fix**: Fixed a bug where the cron job for the Queue Processor could get deleted and never recreated, which would result in notifications getting stuck in the Mail Queue and not being sent out. If you ever installed Comment Mail and then deleted it (without first disabling Data Safeguards), and then installed Comment Mail again, you were probably affected by this issue. This release fixes the issue and makes the cron setup more robust. Props @kristineds, @renzms, @jaswsinc, and @IvanRF for help testing. See [Issue #194](#194) and [Issue #173](#173).
- **Bug Fix:** Fixed a bug where a subscriber who selected Hourly Digest and who had never been notified before could, in some scenarios, have their subscription treated instead as a Weekly Digest. This bug was found and fixed during the codebase restructuring. Props @jaswsinc. See [Issue #150](#150) and additional discussion in [Issue #173](#173 (comment)).
- **Bug Fix:** Fixed a bug where in some scenarios Mail Queue entries for Digest Notifications that should have been held for sending later were not being held and were also not being sent. They also would not have shown up in the Mail Queue Event Log. This bug was found and fixed during the codebase restructuring. Props @jaswsinc. See [Issue #150](#150) and additional discussion in [Issue #173](#173 (comment)).
- **Enhancement**: Minor improvements to the Options Page menu links and positioning of the Pro Preview link. Props @renzms. See [Issue #227](#227).
- **Enhancement**: It's now possible to use the following shortcodes in the Email Footer Tag for Email Footer Templates: `[home_url]`, `[blog_name_clip]`, and `[current_host_path]`. Props @kristineds and @IvanRF. See [Issue #246](#246).
- **Enhancement**: Improved the Subscriptions meta box that appears on the Post Edit screen. For each subscription, the meta box now lists the full name and email address, the date the subscription was created, and a view link that allows you to view/edit the subscription. Props @kristineds. See [Issue #231](#231).
- **UX Enhancement (Pro)**: Improved the Dashboard notice that appears when you try to enable the Pro version of Comment Mail when the Lite version is currently enabled. Props @kristineds @jaswsinc. See [Issue #230](#230).
- **UX Enhancement**: When Subscribing Without Commenting, the Add New Subscription form now pre-populates the Name and Email address fields whenever possible. Props @kristineds. See [Issue #204](#204).
- **UI Enhancement**: Dashboard notices generated by Comment Mail now use the WordPress-style dismiss button to keep things consistent. Props @kristineds. See [Issue #193](#193).
@raamdev
Copy link
Contributor Author

raamdev commented Jun 19, 2016

Comment Mail v160618 has been released and includes changes from this GitHub Issue. See the v160618 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#204).

@wpsharks wpsharks locked and limited conversation to collaborators Jun 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants