Home Support General HivePress Emails and Security

Emails and Security

  • Author
    Posts
  • jackson22

    Hey, First I like to say I love this Plugin already.

    But I have a couple of requests.

    1. I would love to make customizable HTML Emails this would help with making the emails look neat.

    2. If its not possible already : 2FA for users.

    Hope these can be added! 🙂

    ihor developer

    Thanks! If you have a minute, please rate it on WordPress.org https://wordpress.org/support/plugin/hivepress/reviews/

    1. These fields accept HTML markup so you can try adding a HTML template code there.

    2. Thanks, will consider adding this feature.

    jackson22

    I’m trying to add my HTML to the field under HivePress >> Messages but it doesn’t all fit in. How can I add it manually?

    ihor developer

    It’s limited to 2048 characters by default, but if you’re familiar with PHP you can try overriding the email content for all emails and wrap it with some HTML template (so you will not have to duplicate the HTML code in all email fields). The sample snippet below wraps all outgoing emails with a custom DIV:

    add_filter(
    	'hivepress/v1/emails/email',
    	function( $args ) {
    		if ( isset( $args['body'] ) ) {
    			$args['body'] = '<div class="something">' . $args['body'] . '</div>';
    		}
    
    		return $args;
    	}
    );
    jackson22

    I’m not that familiar with PHP, I tried my best but it didn’t seem to work.

    ihor developer

    Please try adding this snippet using this plugin https://wordpress.org/plugins/code-snippets/ Then if you’re familiar with HTML you can try wrapping the email content with any template you like. Also, the visual editing of email templates is on the roadmap.

    jackson22

    Where can I find this roadmap?

    ihor developer

    It’s a private project page at the moment, but I’ll probably make it public to prevent the feature requests for features already planned (I’m using Asana for managing HivePress).

    max

    So when the snipped is active or the function.php altered. Where do we put the HTML code for the email template?

    ihor developer

    You can try replacing the <div... and </div... parts with any email template HTML code you like, it should wrap the HivePress email texts.

    max

    hmm I dont get it to work. Would it be possible to provide an example how this is insterted?
    That would help a lot. Thank you so much in advance

    ihor developer

    In the same way as with the snippet above:

    add_filter(
    	'hivepress/v1/emails/email',
    	function( $args ) {
    		if ( isset( $args['body'] ) ) {
    			$args['body'] = 'any HTML code before the email text' . $args['body'] . 'any HTML code after the email text';
    		}
    
    		return $args;
    	}
    );

    If it’s not urgent you can wait for the next update (up to a week), there will be a common email template for all HivePress emails so it’ll be easy to override it.

    max

    Great. I will wait 🙂
    Thank you so much for all the effort you’re putting into this. This is much appreciated.

    movedbymark

    Just want to confirm, the email update mentioned above has not occurred yet, right?

    I too would love to customize the automated emails. I haven’t added the snippet provided above yet since it sounds like an update is on the way…unless I misunderstood what you meant by “a common email template for all HivePress emails”?

    Thanks Ihor – you’re doing an amazing job!

    P.S. It would be awesome to be able to save some of these threads to “Favorites”. There’s pure gold buried in this support forum and I’ve found it challenging to find the signal in the noise (i.e. documented resolutions and handy snippets), even if I’ve located that information in the past. Just something to consider.

    ihor developer

    This was implemented in the latest update – if you create a /hivepress/email/email-content.php file within the child theme folder it’ll override the default email template. This should be the default file content, you can then wrap it with any HTML email template:

    <?php echo $email->get_body(); ?>

    Thanks, I’ll try to improve the forum UX, I also plan to create a searchable knowledgebase and store the most useful tutorials and code snippets for HivePress there.

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.