subject

Change email subjects for some specific email notifications in Woocommerce

泄露秘密 提交于 2019-12-11 09:49:23
问题 I would like to standardize structure of email subjects (for all Woocommerce emails notifications). Im using all available filters from here But what about “On hold”, “Cancelled”, “Refunded” and “Failed order” email subjects? Is there way to change email subject for those emails? 回答1: Below the 4 hooked functions with the correct filter hooks, that will allow you to customize the email subjects for “On hold”, “Cancelled”, “Refunded” and “Failed order” notifications: add_filter( 'woocommerce

Change email subject for custom order statuses in Woocommerce 3

試著忘記壹切 提交于 2019-12-11 06:55:09
问题 I have successfully changed email subject for Woocommerce processing order (using this thread) : add_filter( 'woocommerce_email_subject_customer_processing_order', 'email_subject_procs_order', 10, 2 ); function email_subject_procs_order( $formated_subject, $order ){ return sprintf( esc_html__( 'Example of subject #%s', 'textdomain'), $order->get_id() ); } But I want send processing order email again with new subject after order status is changed, so I followed this tread to tweak subject etc.

Angular2: subscribe to BehaviorSubject not working

孤街浪徒 提交于 2019-12-11 05:08:41
问题 I have an Alert.Service.ts which saves alerts fetched from another service in an array. In another header.component.ts , I want to get the real-time size of that array. So, in Alert.Service.ts I have @Injectable() export class AlertService { public static alerts: any = []; // Observable alertItem source private alertItemSource = new BehaviorSubject<number>(0); // Observable alertItem stream public alertItem$ = this.alertItemSource.asObservable(); constructor(private monitorService:

Whats the difference between & and & in HTML5? [duplicate]

笑着哭i 提交于 2019-12-10 11:27:07
问题 This question already has answers here : Do I really need to encode '&' as '&'? (16 answers) Closed 6 years ago . What is the difference between & and & ? Like in the code bellow, are both working in the same way? <a href="mailto:EMAIL?subject=BLABLABLA&body=http://URL, SHORT DESCRIPTION"></a> <a href="mailto:EMAIL?subject=BLABLABLA&body=http://URL, SHORT DESCRIPTION"></a> 回答1: In HTML5, they are equivalent in that example. Traditionally, in HTML, only & was correct — but as with so many

Subject is not working when route navigating from one component to another component in Angular 6

▼魔方 西西 提交于 2019-12-07 23:33:17
问题 I have Component A, Component B, and a service. I declared Subject in the service and subscribed the Subject in component B., And I'm sending some data from Component A to the Subject before navigating to component B. It is navigating to component B, but the Subscribe method is not triggering. Service: @Injectable({ providedIn: 'root' }) export class ServiceTestService { storage: Recipe; recipeSelected = new Subject<any>(); constructor() { } } Component A Sending the message to observable

Unit test Angular 2 service subject

亡梦爱人 提交于 2019-12-07 03:35:49
问题 I'm trying to write a test for an angular service which has a Subject property and a method to call .next() on that subject. The service is the following: @Injectable() export class SubjectService { serviceSubjectProperty$: Subject<any> = new Subject(); callNextOnSubject(data: any) { this.serviceSubjectProperty$.next(data); } } And the test file for that service: import { TestBed, inject } from '@angular/core/testing'; import { SubjectService } from './subject.service'; describe(

Whats the difference between & and & in HTML5? [duplicate]

我们两清 提交于 2019-12-06 05:37:49
This question already has answers here : Do I really need to encode '&' as '&'? (17 answers) Closed 6 years ago . What is the difference between & and & ? Like in the code bellow, are both working in the same way? <a href="mailto:EMAIL?subject=BLABLABLA&body=http://URL, SHORT DESCRIPTION"></a> <a href="mailto:EMAIL?subject=BLABLABLA&body=http://URL, SHORT DESCRIPTION"></a> In HTML5, they are equivalent in that example. Traditionally, in HTML, only & was correct — but as with so many things, web developers blithely ignored this inconvenient rule and wrote bare ampersands everywhere. For their

Unit test Angular 2 service subject

房东的猫 提交于 2019-12-05 07:35:13
I'm trying to write a test for an angular service which has a Subject property and a method to call .next() on that subject. The service is the following: @Injectable() export class SubjectService { serviceSubjectProperty$: Subject<any> = new Subject(); callNextOnSubject(data: any) { this.serviceSubjectProperty$.next(data); } } And the test file for that service: import { TestBed, inject } from '@angular/core/testing'; import { SubjectService } from './subject.service'; describe('SubjectService', () => { beforeEach(() => { TestBed.configureTestingModule({ providers: [ SubjectService ] }); });

Subject.next not firing in ngOnInit

给你一囗甜甜゛ 提交于 2019-12-05 03:57:21
Does anyone why this code (initializing a value from Subject) does not work? Is there a bug or by design? What am I doing wrong? ts import { Component, OnInit } from '@angular/core'; import { Subject } from "rxjs"; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.styl'] }) export class AppComponent implements OnInit { itemSupplier$: Subject<any[]> = new Subject<any[]>(); items: any[] = [ {name: 'Item 1', value: 'item1'}, {name: 'Item 2', value: 'item2'}, ]; ngOnInit(){ this.itemSupplier$.next(this.items); } } html <ul> <li *ngFor="let item of

Non replaying hot observable

ぐ巨炮叔叔 提交于 2019-12-05 00:16:46
问题 Original question I have a scenario where I have multiple IObservable sequences which I want to combine with Merge and then listen to. However, if one of these produces an error I don't want it to crash everything for the other streams, as well as to resubscribe to the sequence (this is an 'ever lasting' sequence). I do this by appending a Retry() to the streams before merge, i.e.: IEnumerable<IObservable<int>> observables = GetObservables(); observables .Select(o => o.Retry()) .Merge()