How to Insert Custom Snippet into HTML Article Automation

I have an automation where I automatically create my Ghost CMS posts from another source I have. The post format is in HTML(which is what the ghost API accepts).

I want to figure out what the HTML text is to insert a specific custom snippet into the HTML code(from my automation) so that when the post is created, that the custom snippet shows up without me having to manually go in and add it.

Here is a picture below of what I mean by custom snippet:


I want to be able to insert this snippet into the HTML code that is sent to the Ghost API

Thank you so much!!!

The snippets endpoint did not take an api key as of a few months ago.

Does the snippet change regularly? Does it have to be a ghost snippet, or will some html in a card meet your needs?

Aside: forms don’t work super well in email. That’s not a ghost thing, but a mail client security thing.

1 Like

I am okay with the email part; since I only distribute custom editorials to my newsletter.

The snippet is the Signup card with the custom background and stuff. It rarely needs change. It does not need to be a Ghost Snippet, although preferred, but something that looks like that(and has the working sign-up functionality) but it has to be able to work with the HTML input to the Ghost API to create a new article.

Here is what I mean by HTML input:

<p>A research paper published in <strong>Aging</strong> explored the long-term consequences of lifesaving treatments such as hormone replacement therapy (HCT) and chemotherapy in breast cancer patients. These findings reveal significant impacts on the patients’ quality of life and longevity.</p> <h2>Treatment Comes at a Cost</h2> <p>HCTs and breast cancer treatments, while essential, come with side effects. For instance, <em>chemotherapy</em> sharply increases <strong>p16INK4a</strong>, a key biomarker of cellular senescence, whereas HCTs have been linked to <strong>accelerated aging</strong>. Consequently, individuals undergoing such treatments may develop frailty, exhibiting physical abilities similar to those of older individuals. Several symptoms were documented, such as:</p> <ul> <li><strong>Constant exhaustion</strong>: Reported by over 75% of patients.</li> <li><em>Unintentional significant weight loss</em>: On average, a reduction of <strong>7%</strong> body weight over 6 months.</li> <li>Slow walking speed: Gait speed reduction of <em>20%</em> compared to healthy peers.</li> <li>Limited physical activity: A <strong>40%</strong> decrease in weekly exercise routines.</li> <li>Poor grip strength: A key marker of physical frailty and loss of muscle mass.</li> </ul> <p>Patients who demonstrated one or two of these symptoms were deemed <strong>pre-frail</strong>, while those who exhibited three or more were classified as <strong>physically frail</strong>.</p> <h2>Impact on Quality of Life and Longevity</h2> <p>The impact of these treatments is multifaceted, affecting both the physical and emotional well-being of patients. Below is a breakdown of some of the research findings:</p> <table> <thead> <tr> <th>Aspect</th> <th>Findings</th> <th>Source</th> </tr> </thead> <tbody> <tr> <td>Frailty Markers</td> <td>Elevated levels of p16INK4a, indicating biological aging.</td> <td>Study 1</td> </tr> <tr> <td>Quality of Life (QoL)</td> <td>Significant decline in physical, emotional, and social well-being.</td> <td>Study 2</td> </tr> <tr> <td>Mortality Risk</td> <td>Heightened risk of early mortality associated with frailty.</td> <td>Study 3</td> </tr> </tbody> </table> <h2>Associations Between Treatment and Aging</h2> <p>The relationship between <strong>frailty</strong> and treatment is complex, with various contributing factors:</p> <table> <thead> <tr> <th>Factor</th> <th>Correlation with Frailty</th> </tr> </thead> <tbody> <tr> <td>Age at Diagnosis</td> <td>Older patients exhibit a higher level of frailty.</td> </tr> <tr> <td>Treatment Duration</td> <td>Longer treatments correlate with increased frailty.</td> </tr> <tr> <td>Type of Therapy</td> <td>Patients undergoing HCT have a greater risk of frailty compared to those receiving chemotherapy.</td> </tr> </tbody> </table> <ul> <li><strong>Chronological Age vs. Biological Age</strong>: While chronological age is a predictor, <em>biological markers</em> like <strong>p16INK4a</strong> serve as better indicators of frailty.</li> <li><em>Length of Time Since Treatment</em>: Those treated within the last 3-5 years show higher levels of frailty.</li> <li><strong>Therapy Type</strong>: Chemotherapy and HCT show distinct correlations with biological aging, with HCT being more associated with greater frailty.</li> </ul> <blockquote> “The acceleration of biological aging resulting from these treatments necessitates the development of new approaches that mitigate long-term harm while preserving the lifesaving benefits.” – Dr. John Smith, Lead Researcher </blockquote> <h2>Future Directions</h2> <p>To improve patient outcomes, researchers emphasize the need for treatments that minimize adverse effects. Current studies focus on:</p> <ul> <li>Developing <strong>less aggressive chemotherapy protocols</strong> that reduce senescent cell burden.</li> <li>Incorporating <strong>lifestyle interventions</strong> such as exercise, nutrition, and stress management to lower frailty risk.</li> <li>Utilizing <strong>biomarkers like p16INK4a</strong> to identify patients at higher risk of accelerated aging due to treatment.</li> </ul> <p>Balancing <em>treatment efficacy</em> with <em>patient quality of life</em> is critical in reducing the long-term negative impacts of these cancer therapies.</p> <hr /> <h3>Literature Cited</h3> <p>[1] Shachar, S. S., et al. (2020). Effects of breast cancer adjuvant chemotherapy on aging biomarkers. JNCI Cancer Spectrum.</p> <p>[2] Uziel, O., et al. (2020). Premature aging following allogeneic hematopoietic stem cell transplantation. Bone Marrow Transplantation.</p> <p>[3] Ness, K. K., et al. (2013). Physiologic frailty and aging in cancer survivors. Journal of Clinical Oncology.</p> <p>[4] Arora, M., et al. (2016). Frailty in nonelderly transplant patients. JAMA Oncology.</p>

This is passed into the Ghost API to create a new article(see picture below):


Also, thank you for taking the time to help me with this

So I’m sure you can do that if you pass in lexical. For html, it may be possible but I don’t know exactly what html is recognized as a sign up card.