Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Bill Edwards Posted August 16, 2017 Posted August 16, 2017 Dear All When a warning is emailed to a member it includes a line "Penalty: Given 1 point which will never expire". I want to remove this line. Using a process of trial and error I have successfully removed it from the HTML email. However, try as I might, I can't remove it from the Plain Text email. I either get an error or it takes out too much text and I lose the other lines. The code is {{$content = $warning->content();}} {{if $content && $content instanceof \IPS\Content\Comment}} {{$item = $content->item();}} {$email->language->addToStack("email_warned_comment", FALSE, array( 'sprintf' => array( \IPS\Member::load( $warning->moderator )->name, $item->indefiniteArticle( $email->language ) ) ) )} {$content->item()->mapped('title')} {{elseif $content}} {$email->language->addToStack("email_warned_item", FALSE, array( 'sprintf' => array( \IPS\Member::load( $warning->moderator )->name, $content->indefiniteArticle( $email->language ) ) ) )} {$content->mapped('title')} {{else}} {$email->language->addToStack("email_warned_other", FALSE, array( 'sprintf' => array( \IPS\Member::load( $warning->moderator )->name ) ) )} {{endif}} ===== {{if $warning->canViewDetails()}}{$email->language->addToStack("email_warn_reason", FALSE)}:{$email->language->addToStack("core_warn_reason_" . $warning->reason, FALSE)}{{endif}} {{if $content}}{$email->language->addToStack("email_warn_source", FALSE)}: {{if $content instanceof \IPS\Content\Comment}}{$content->item()->mapped('title')}{{else}}{$content->mapped('title')}{{endif}}{{endif}} {{if $warning->canViewDetails() or $warning->mq or $warning->rpa or $warning->suspend}}{$email->language->addToStack("email_warn_penalty", FALSE)}: {{if $warning->canViewDetails()}} {{if $warning->expire_date}} {{if $warning->expire_date < time()}} {{if $warning->expire_date == -1}} {$email->language->addToStack("warn_action_points_never_expire", FALSE, array( 'sprintf' => array( $warning->points ) ) )} {{else}} {$email->language->addToStack("warn_action_points_expired", FALSE, array( 'sprintf' => array( $warning->points, \IPS\DateTime::ts( $warning->expire_date ) ) ) )} {{endif}} {{else}} {$email->language->addToStack("warn_action_points_expire", FALSE, array( 'sprintf' => array( $warning->points, \IPS\DateTime::ts( $warning->expire_date ) ) ) )} {{endif}} {{else}} {$email->language->addToStack("warn_action_points", FALSE, array( 'sprintf' => array( $warning->points ) ) )} {{endif}} {{endif}} {{if $warning->mq}} {$email->language->addToStack("moderation_modq", FALSE)} - {{if $warning->mq == -1}}{$email->language->addToStack("indefinitely", FALSE)}{{else}}{expression="\IPS\DateTime::formatInterval( new \DateInterval( $warning->mq ), 2, $email->language )"}{{endif}} {{endif}} {{if $warning->rpa}} {$email->language->addToStack("moderation_nopost", FALSE)} - {{if $warning->rpa == -1}}{$email->language->addToStack("indefinitely", FALSE)}{{else}}{expression="\IPS\DateTime::formatInterval( new \DateInterval( $warning->rpa ), 2, $email->language )"}{{endif}} {{endif}} {{if $warning->suspend}} {$email->language->addToStack("moderation_banned", FALSE)} - {{if $warning->suspend == -1}}{$email->language->addToStack("indefinitely", FALSE)}{{else}}{expression="\IPS\DateTime::formatInterval( new \DateInterval( $warning->suspend ), 2, $email->language )"}{{endif}} {{endif}} {{endif}} ===== {{if \IPS\Settings::i()->warnings_acknowledge && !$warning->acknowledged && $warning->canAcknowledge(\IPS\Member::load($warning->member))}} **{$email->language->addToStack("email_warn_acknowledge", FALSE)}** {$email->language->addToStack("email_warn_acknowledge_button", FALSE)}: {$warning->url()} {{endif}} -- {setting="board_name"} Please, please can anyone assist with what I need to take out of this code to remove the line "Penalty: Given 1 point which will never expire". Many thanks Bill
Adriano Faria Posted August 16, 2017 Posted August 16, 2017 Not tested, but I think it's enough you remove: {{if $warning->canViewDetails() or $warning->mq or $warning->rpa or $warning->suspend}}{$email->language->addToStack("email_warn_penalty", FALSE)}: {{if $warning->canViewDetails()}} {{if $warning->expire_date}} {{if $warning->expire_date < time()}} {{if $warning->expire_date == -1}} {$email->language->addToStack("warn_action_points_never_expire", FALSE, array( 'sprintf' => array( $warning->points ) ) )} {{else}} {$email->language->addToStack("warn_action_points_expired", FALSE, array( 'sprintf' => array( $warning->points, \IPS\DateTime::ts( $warning->expire_date ) ) ) )} {{endif}} {{else}} {$email->language->addToStack("warn_action_points_expire", FALSE, array( 'sprintf' => array( $warning->points, \IPS\DateTime::ts( $warning->expire_date ) ) ) )} {{endif}} {{else}} {$email->language->addToStack("warn_action_points", FALSE, array( 'sprintf' => array( $warning->points ) ) )} {{endif}} {{endif}} {{if $warning->mq}} {$email->language->addToStack("moderation_modq", FALSE)} - {{if $warning->mq == -1}}{$email->language->addToStack("indefinitely", FALSE)}{{else}}{expression="\IPS\DateTime::formatInterval( new \DateInterval( $warning->mq ), 2, $email->language )"}{{endif}} {{endif}} {{if $warning->rpa}} {$email->language->addToStack("moderation_nopost", FALSE)} - {{if $warning->rpa == -1}}{$email->language->addToStack("indefinitely", FALSE)}{{else}}{expression="\IPS\DateTime::formatInterval( new \DateInterval( $warning->rpa ), 2, $email->language )"}{{endif}} {{endif}} {{if $warning->suspend}} {$email->language->addToStack("moderation_banned", FALSE)} - {{if $warning->suspend == -1}}{$email->language->addToStack("indefinitely", FALSE)}{{else}}{expression="\IPS\DateTime::formatInterval( new \DateInterval( $warning->suspend ), 2, $email->language )"}{{endif}} {{endif}} {{endif}}
Bill Edwards Posted August 16, 2017 Author Posted August 16, 2017 Many thanks @Adriano Faria Unfortunately that doesn't work It changes "You have received a message from Bill Edwards about a comment made in a topic, Test Post - Please Ignore" to "You have been warned by Bill Edwards" and removes the Reason & Content lines as well
Adriano Faria Posted August 16, 2017 Posted August 16, 2017 Weird. Reason and Content is above of what I requested to delete, as you can see: {{if $warning->canViewDetails()}}{$email->language->addToStack("email_warn_reason", FALSE)}:{$email->language->addToStack("core_warn_reason_" . $warning->reason, FALSE)}{{endif}} {{if $content}}{$email->language->addToStack("email_warn_source", FALSE)}: {{if $content instanceof \IPS\Content\Comment}}{$content->item()->mapped('title')}{{else}}{$content->mapped('title')}{{endif}}{{endif}} {{if $warning->canViewDetails() or $warning->mq or $warning->rpa or $warning->suspend}}{$email->language->addToStack("email_warn_penalty", FALSE)}:
Bill Edwards Posted August 16, 2017 Author Posted August 16, 2017 I've been deleting lines in order for two days now and can't make it work. Tech Support class it as "customisation" and refuse point blank to help
Recommended Posts
Archived
This topic is now archived and is closed to further replies.